david hol
david hol

Reputation: 1280

Wait for element with Selenium - what is the different of using pollingEvery

Consider this:

FluentWait fluentWait = new FluentWait[WebDriver](driver)
      .withTimeout(timeOut, TimeUnit.SECONDS)
      .pollingEvery(10, TimeUnit.SECONDS)

fluentWait(120).until(ExpectedConditions.elementToBeClickable(element))

What is the different of using fluentWait with pollingEvery and without pollingEvery ? What does pollingEvery going ?

Upvotes: 0

Views: 332

Answers (1)

k.s. Karthik
k.s. Karthik

Reputation: 761

In Fluent wait, if we specify pollingEvery, driver will check the availability for a particular element, for every n (10 in this case) seconds (frequency) specified like pollingEvery(10, TimeUnit.SECONDS). If we do not specify the same, by default it will check with the frequency of 500 milliseconds.

Hope this helps

Upvotes: 3

Related Questions