Selenium WebDriver和Highchart测试 [英] Selenium WebDriver and Highchart testing

查看:127
本文介绍了Selenium WebDriver和Highchart测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经在S.O.上面提过了。和其他网站,但我还没有找到明确的答案 - 他们中的大多数人表示不容易做到,但我想确保这是最终的裁决。



这里是我的情况:

我使用Selenium WebDriver(Java)测试使用Highcharts(http://www.highcharts.com)的网站。



我基本上想要获取当您将鼠标悬停在Highchart线形图上的每个数据点时显示的小工具提示弹出窗口中显示的信息。



查看网页的HTML代码,我注意到< g class =highcharts-tooltip... 。我还注意到,当您移动鼠标时, ... transform =translate(X,Y)中的(X,Y) > 更改,然后更改工具提示中显示的信息。



知道这一点,我的方法是以某种方式抓住所有(X,Y)值并将它们插入到 transform 字段中并获取工具提示数据。但我不知道如何以编程方式通过Selenium获取所有(X,Y)值。



任何人在过去解决这个问题或有更好的方法来获取必要的信息?

我开始创建一个库工作与HighCharts,我现在有什么可在这里:



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



很难提供一个处理HighCharts的通用库,因为各个图表上的自定义选项可以相当多地修改SVG标记。希望以上内容对学位有所帮助。



随着我做得更多,它会被更新。


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?

解决方案

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.

这篇关于Selenium WebDriver和Highchart测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆