小编del*_*ame的帖子

org.openqa.selenium.WebDriverException:未知错误:无法读取未定义的属性“defaultView”

在执行使用 Cucumber 框架编写的 n selenium 自动化脚本时,我收到以下异常

org.openqa.selenium.WebDriverException: 
    unknown error: Cannot read property 'defaultView' of undefined
Run Code Online (Sandbox Code Playgroud)

以前在 spring 19 之前发布通过的脚本。在 spring 19 脚本失败并显示 ablve 异常之后

public void waitForElementToBeDisplayed(WebElement element) {
    driver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);
    LOGGER.info("element is " +element);
    LOGGER.info(String.format("Waiting for WebElement '%s' to be displayed", element.toString().replaceAll(".*-> ", "").replace("]", "")));
    element = new WebDriverWait(driver, 40).until(ExpectedConditions.visibilityOf(element));
    Assert.assertTrue(element.isDisplayed());
}
Run Code Online (Sandbox Code Playgroud)

selenium defaultview salesforce undefined uncaught-exception

5
推荐指数
1
解决办法
4638
查看次数