Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium WebDriver and Highchart testing

I know this question has been asked before on S.O. and other websites but I haven't found a definite answer -- most of them say its not easily done but I wanted to make sure that was the final verdict.

Here's my situation:

I'm testing a website that is using Highcharts (http://www.highcharts.com) using Selenium WebDriver (Java).

I basically want to grab the information that is displayed in a small tooltip pop-up that appears when you hover your mouse over each datapoint on the Highchart's line graph.

Looking at the web page's HTML code, I noticed there is <g class="highcharts-tooltip".... I also noticed that, as you move your mouse, the (X,Y) values in ...transform="translate(X,Y)"> change, which then changes the information displayed in the tool tip.

Knowing this, my approach would be to somehow grab all the (X,Y) values and plug them into the transform fields and grab the tooltip data. But I don't know how to programmatically grab all the (X,Y) values through Selenium.

Has anyone tackles this issue in the past or has a better way to grab the necessary information?

like image 558
FilmiHero Avatar asked Dec 20 '25 23:12

FilmiHero


1 Answers

I started creating a library to work with HighCharts, what I currently have is available here:

https://github.com/Ardesco/Powder-Monkey/tree/master/src/main/java/com/lazerycode/selenium/graphs

It's quite hard to provide a generic library that deals with HighCharts as the customisation options on the individual charts can modify the SVG markup quite a bit. Hopefully the above will help to a degree.

As I do more it will be updated.

like image 70
Ardesco Avatar answered Dec 22 '25 13:12

Ardesco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!