How to add polling in explicit wait and avoid getting the no such element error

How to add polling in explicit wait and avoid getting the no such element error for the duration of the wait time being set?

Hi Dipen,

we can use a command called fluent wait, which is an extension of the explicit wait command. With fluent wait, we can also set the frequency with which the condition is checked before throwing the element Not Visible exception.

Wait wait = new FluentWait<WebDriver>(driver)

.withTimeout(45, TimeUnit.SECONDS)

.pollingevery(5, TimeUnit.SECONDS)

.ignoring(NoSuchElementException.class);```



While a timeout value is a time taken to wait for a condition, polling frequency is the frequency to check the success or failure of the condition.