If explicitely wait is having default polling time i.e. 500ms then why don't it throws an exception after first 500ms if the condition is not satisfied?
What is the role of default polling time in explicite wait?
If explicitely wait is having default polling time i.e. 500ms then why don't it throws an exception after first 500ms if the condition is not satisfied?
What is the role of default polling time in explicite wait?
I think you are mixing/getting confused between polling time and wait time.
Polling time: is the repeated time interval at which selenium tries to locate an element in the DOM
Wait time: is the maximum time it will wait trying to locate the element, after which it will throw timeout exception
In the below code, selenium tries to locate the element
for 40s before it throws timeout exception
. And in those 40s, it tries to locate/poll every 2s. If you do not add this line wait.pollingEvery(2, TimeUnit.SECONDS);
, then by default it will try to locate/poll every 500ms(0.5s)
WebDriverWait wait = new WebDriverWait(driver, 40);
wait.pollingEvery(2, TimeUnit.SECONDS);
wait.until(ExpectedConditions.elementToBeClickable(element));
This is my understanding. Hope this helps.