使用此代码时出现错误,错误是
“FluentWait 类型的 withTimeout(Duration) 方法不适用于参数 (int, TimeUnit)”
Wait wait = new FluentWait(driver)
.withTimeout(30, SECONDS)
.pollingEvery(5, SECONDS)
.ignoring(NoSuchElementException.class);
使用此代码时出现错误,错误是
“FluentWait 类型的 withTimeout(Duration) 方法不适用于参数 (int, TimeUnit)”
Wait wait = new FluentWait(driver)
.withTimeout(30, SECONDS)
.pollingEvery(5, SECONDS)
.ignoring(NoSuchElementException.class);
这是现在正确的用法..
Wait wait = new FluentWait(driver).withTimeout(Duration.ofSeconds(30)).pollingEvery(Duration.ofSeconds(30))
.ignoring(NoSuchElementException.class);
我进行了搜索,以下代码对我有用
Wait<WebDriver> wait = new FluentWait<WebDriver>(driver)
.withTimeout(10, TimeUnit.SECONDS)
.pollingEvery(2, TimeUnit.SECONDS)
.ignoring(NoSuchElementException.class);