当我们不像下面这样指定时,FluentWait的默认超时是多少,但是我知道默认轮询是500毫秒。
FluentWait<WebDriver> wait=new FluentWait<WebDriver>(dr)
//.withTimeout(Duration.ofSeconds(20))
//.pollingEvery(Duration.ofSeconds(2))
.ignoring(NoSuchElementException.class);
在超时异常中,我看到-
Exception in thread "main" org.openqa.selenium.TimeoutException:(tried for 0 second(s) with 500 milliseconds interval)
这是否意味着我们默认的最大超时为0秒。当我通过documentation时-它说DEFAULT_SLEEP_TIMEOUT为500L
每个FluentWait实例定义等待条件的最长时间,默认为500毫秒。您已经提到过,从文档中也可以从FluentWait.java