我正在一个 web 应用程序中工作,其中 webdriver 测试在 Firefox 29 中成功运行。该 web 应用程序已从 dojo 1.7.2 升级到 1.9.1,现在 Selenium 2.44.0 抛出 NoSuchElementException。异常来自此函数:
pTestCase._waitForElementByXPath("/html/body/div[@style='opacity: 0; display: none;']");
public WebElement _waitForElementByXPath(String elementXPath) throws InterruptedException {
return _waitForElementByXPath(elementXPath,STANDARD_TIMEOUT);
}
public WebElement _waitForElementByXPath(String elementXPath, int timeout) throws InterruptedException {
driver.manage().timeouts().implicitlyWait(timeout, TimeUnit.SECONDS);
return driver.findElement(By.xpath(elementXPath));
}
有谁知道我以前是如何通过 xpath 获取 web 元素的,现在我不能使用新版本的 dojo?
Selenium 版本:2.44.0 Firefox 版本:29.0 Dojo 版本:1.9.1