Selenium WebDriverWait抛出org.openqa.selenium.WebDriverException:java.lang.InterruptedException:睡眠中断

时间:2018-08-02 14:47:10

标签: selenium webdriverwait

我有考试

 @Then("^the URL path is updated to \"([^\"]*)\"$")
  public void theURLPathIsUpdatedTo(String path) throws Throwable {
    WebDriver driver = getWebDriver();
    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(ExpectedConditions.urlContains(path));
  }

但是它总是抛出错误-

org.openqa.selenium.WebDriverException: java.lang.InterruptedException: sleep interrupted
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'janakir-1mbpdu.oa.oclc.org', ip: '10.200.19.82', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_151'
Driver info: driver.version: unknown
    at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:268)
    at org.oclc.eui.reference.verification.cucumber.ReferenceAppStepDefs.theURLPathIsUpdatedTo(ReferenceAppStepDefs.java:400)
    at ✽.Then the URL path is updated to "/?page=1"(org/repo/myproject/verification/cucumber/features/pagination.feature:36)
Caused by: java.lang.InterruptedException: sleep interrupted

第400行为wait.until(ExpectedConditions.urlContains(path));

为什么会这样?

0 个答案:

没有答案