NosuchElement error while hovering highchart tooltip using selenium webdriver
I am trying to use https://github.com/Ardesco/Powder-Monkey/blob/master/src/main/java/com/lazerycode/selenium/graphs/LineChart.java code to test tooltip values for highchart graph. But I am getting the error:
"Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: {"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/88734.html