Selenium Webdriver: how to get data from highcharts

755 views
Skip to first unread message

ama...@bufetedemarketing.com

unread,
May 5, 2017, 6:44:20 AM5/5/17
to Selenium Users
Hi guys!

I have a web page with highcharts of this type: https://www.highcharts.com/demo/line-ajax

I would like to get the data "hiden" in that highchart from Selenium Webdriver.


But when I run this in a new class in my package in Eclipse, I don't get anything from that execution (no errors nor data).
I don't know if I have to put that java code in the same class where I log in my page and navigate through it, or I need to use that java code in another place...
I attach an image of my Eclipse project.



Thanks so much in advance!!!


praveen kumar cherukuri

unread,
May 5, 2017, 8:57:11 AM5/5/17
to seleniu...@googlegroups.com
At the first glance: 
Step 1: Clone the git project to your local
Step 2: Compile and build the project. Follow steps to include this project in your project (simple if you use maven) 
Step 3: Use the functions which were shown on the Github examples (link shared by you in the thread) 

Feel free to ask more details. 



photo 
Praveen Kumar Cherukuri
Test Automation ExpertQA-Masters 
pra...@qa-masters.com | Skype:  praveen_cherukuri |
 www.qa-masters.com | Trainers Outsourcing | Experts in QA Training | Technical Project Support


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/9dfd9516-561d-4011-8c37-58f0a3669f4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ama...@bufetedemarketing.com

unread,
May 8, 2017, 7:34:22 AM5/8/17
to Selenium Users
Hi again!

I'm still writing this case with Webdriver and I still have problems to automate the test. Now, I can get the data from the highcharts (with the following commands from Eclipse:

String tooltipPlace = myTestDriver.findElement(By.cssSelector("g.highcharts-xaxis-labels > text:nth-child(1) > tspan:nth-child(1)")).getText();
           System.out.println(tooltipPlace);
           
           String tooltipYear = myTestDriver.findElement(By.cssSelector("g.highcharts-legend-item:nth-child(3) > text:nth-child(1) > tspan:nth-child(1)")).getText();
           System.out.println(tooltipYear);
           
           String tooltip = myTestDriver.findElement(By.cssSelector("g.highcharts-data-label-color-2:nth-child(3) > text:nth-child(1) > tspan:nth-child(1)")).getText();
             System.out.println(tooltip);

But now, I get the following errors when I try to log to my web page (with user and password):

//I start clicking in one elemen of the page to navigate and appears the following errors:

*** Element info: {Using=xpath, value=//div[@id='__sizzle__']/div[2]/table/tbody/tr/td/span[2]} 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:150)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:115)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:45)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:410)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:509)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:402)

I've tried to attach the rt.jar file, but I don't find the .jar file in Google to download: 
...

Could anyone help me??

Thanks so much!!!
 
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages