我想知道是否有人可以指导我如何使用 Protractor 测试 svg 饼图和图表。
我必须在将鼠标悬停在饼图上时读取饼图上的数据,或者在将鼠标悬停在数据点上时读取图表上的数据。
除了文本数据外,饼图与下面的饼图非常相似。检查 2D 饼图示例:http://www.fusioncharts.com/charts/pie-doughnut-charts/
最佳答案
我通过 xpath 获取数据 - 尽管它与正常情况有点不同。要访问 svg:
element(by.xpath('//*[name() = "svg"]//the rest of the path'))
关于selenium - 如何使用 Protractor 测试 svg 饼图和图形?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28973918/