• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Calculate a Bubble Value that Goes with a Source

 
Ranch Hand
Posts: 246
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Kevin Simonson
Ranch Hand
Posts: 246
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kevin Simonson wrote: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.


Never mind! Speaking of minds, I think I'm losing mine. I forgot which forum I posted my article to; I actually posted it to a Selenium-specific forum; I went over there just now and found my original post and the solution, so I don't need any help on this forum.

Kevin Simonson
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds as bad as me! I lose things all the time; I have lost three pairs of glasses in the last week, and fortunately found them all again. Please post a link to the other forum, so anybody interested can find your solution.
 
Kevin Simonson
Ranch Hand
Posts: 246
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Please post a link to the other forum, so anybody interested can find your solution.


It's at "https://groups.google.com/forum/?fromgroups#!forum/webdriver". The subject line is the same as this thread's.

Kevin S
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you. Yes, the solution was on that google link.
 
It's feeding time! Give me the food you were going to give to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic