使用selenium webdriver悬停高级工具提示时出现NosuchElement错误

时间:2016-06-08 14:30:12

标签: java selenium-webdriver highcharts

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

  

“线程中的异常”主“   org.openqa.selenium.NoSuchElementException:无法找到元素:   {“method”:“css selector”,“selector”:“g.highcharts-series-group>   G:第n个孩子(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");
}

0 个答案:

没有答案
相关问题