Last Saturday I posted an article to this forum that prompted one poster to reply with a method that looked like it would solve my problem. But I neglected to save that method yesterday, and today my
thread appears to be gone! I can't find it anywhere. So I'm reposting it now and I'm begging that poster to please re-post his reply, if s/he has it stored somewhere.
############################################################################
Right now I'm using Selenium to create three sources, that I've named "Orange", "Yellow", and "Green", and then I'm trying to figure out how many events each of these three sources are assigned to. In order to figure out the <id>s, <className>s, etc. of the different elements I'm using Firebug. The relevant output I get is:
You can see the three divisions in the second level <div>s up there; the first one's second <a> tag has text "Green", the second one's second <a> tag has text "Yellow", and the third one's second <a> tag has text "Green". For each division there's a <div> a few levels down that has <className> "bubble", and the number I want is the text of that <div>. So the number for "Orange" is 0, the number for "Yellow" is 1, and the number for "Green" is 0.
The <id>s of the three divisions are "lkgRef-fs-ft.ctpsr.MMMM-QXX", "lkgRef-fs-ft.ctpsr.MMMM-QX6", and "lkgRef-fs-ft.ctpsr.MMMM-QXD", but since my three sources are dynamically created those three <id>s could be very different from those three values when my code runs them in the future, couldn't they? I thought of accessing those three <div>s by iterating through each by <className>, and picking the one that matches the given color, but the <className>s are each "sourceBox show", which is two words, and when I tried that my compiler complained about being unable to process compound words.
In the end I wrote the following method to generate "bubble" text for any given source name:
This code actually works, but it's incredibly slow; it runs an average of 130 seconds for each source. So my question is, is there a better way of calculating the {WebElement} corresponding to the "bubble" that is faster than this method?
Kevin S