【发布时间】:2018-04-09 08:56:25
【问题描述】:
我正在运行一组来自 Jenkins 的测试用例。所有测试用例在所有功能上都以org.openqa.selenium.TimedoutException 失败。我已经在本地使用 eclipse 测试了相同的代码,并且执行良好。请检查以下错误并帮助解决此问题
配置:
Selenium- standalone - jar - 2.53
Chromedriver - 2.36
Chrome Browser - 65
testng jar = 6.8
代码示例:
WebDriverWait wait = new WebDriverWait(driver, 1000);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(ORCollection.get("BtnMDUEligibilityClick").toString())));
WebElement el = driver.findElement(By.xpath(ORCollection.get("BtnMDUEligibilityClick").toString()));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", el);
WebElementClick(" ",ORCollection.get("BtnMDUEligibilityClick").toString());
Thread.sleep(10000);
日志:
org.openqa.selenium.TimeoutException: Timed out after 40 seconds waiting for visibility of element located by By.xpath: //button[contains(@class,'js-submit')]
我已将代码中的 webdriver.wait 值从 40 秒增加到 1000 秒,但仍然遇到与 Timedout 相同的错误。
【问题讨论】:
标签: google-chrome selenium selenium-webdriver xpath testng