我正在运行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相同的错误。