If I have given 30sec of implicit wait for an element to click,and the script is able to find the element in 10th second itself,will it still wait or click the element? The same situation,I want to know for explicit wait too..will it wait or click it on the 10th second itself??
Implicit wait
means findElement()
and findElements()
methods will try to locate the element(s) up to specified amount of time. The only condition is that the element(s) exists in the DOM.
Explicit wait
means the driver will try to locate the element and then check if the located element is in the expected state (visible, enabled, stale etc).
Both waits samples the DOM every 500 ms (default) until the condition is met or the specified time ends, the earlier one (unlike Thread.sleep(30000)
that will hold the program for 30 seconds no meter what).