使用硒webdriver悬停高图表工具提示时出现NosuchElement错误

我正在尝试使用https://github.com/Ardesco/Powder-Monkey/blob/master/src/main/java/com/lazerycode/selenium/graphs/LineChart.java代码来测试Highchart图形的工具提示值。 但是我收到错误:

“线程中的异常”main“org.openqa.selenium.NoSuchElementException:无法找到元素:{”method“:”css selector“,”selector“:”g.highcharts-series-group> g:nth-​​child(1 ) “}”

WebDriver driver = new FirefoxDriver();
String baseUrl = "http://www.highcharts.com/demo/line-basic";

// launch Firefox and direct it to the Base URL
driver.get(baseUrl);
WebElement highChartSVGElement = driver.findElement(By.className("highcharts-container"));
LineChart chartObject = new LineChart(driver, highChartSVGElement);
if(chartObject.isChartDisplayed() && chartObject.isTooltipDisplayed()) {
    chartObject.hoverOverPointOfGraphAtXAxisLabel("Jan");
}
链接地址: http://www.djcxy.com/p/88733.html

上一篇: NosuchElement error while hovering highchart tooltip using selenium webdriver

下一篇: Selecting relational highchart SVG images with Selenium