Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
939 views
by Contributing Tester (14 points)
edited by
Hello!  I am a new member and first-time poster.  I am a Senior Q/A Automation Test Engineer for a large company in Florida, USA.  I am using Java-Selenium-WebDriver in the Eclipse environment.  I am automating our javascript-based web site, and trying to automate the capturing of data attributes form a bar chart.  I have been able to do this (using the .getAttribute("height") API, for example), by capturing the CSS of each bar.  However, the number of bars is going to be variable at run-time, so I cannot expect to use "hard-coded" CSS (or even XPATH) values).  I have not yet been able to figure out the code to retrieve the number of such bars on the bar graph, and thus, create dynamically CSS values, so I can then thus iterate through the bars and get their attributes, dynamically, at run-time, that way.  Any help, especially code examples, greatly appreciated
by Master (1.2k points)
Can you share your HTML? or some site that have similar chart?

1 Answer

0 like 0 dislike
by
Simply have a loop from 1 to large number , say 100 in a try except block. If element not found exception happens, then break the loop.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...