在使用黄瓜框架执行编写 n selenium 的自动化脚本时,我得到以下异常
org.openqa.selenium.WebDriverException:
unknown error: Cannot read property 'defaultView' of undefined
以前在 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());
}