What are the different types of waits available in WebDriver?

1. Implicit Waits 2. Explicit Waits 3. Fluent Wait

The Implicit Wait is specific to the entire Browser or all the elements in the browser. When you define certain period (say 10 Secs) it suspends the further action for 10 secs. It doesn't bother whether the particular/all element(s) loaded or not on the browser.
Different elements on the page takes different times to load on the page, if we use implicit wait for 10 Sec there is no guarantee that all the elements loaded within 10 sec, some elements may take more than 1 minute, in such conditions Explicit waits can be used to wait for that particular element.

The explicit wait is used to tell the Web Driver to wait for certain conditions (Expected Conditions) or the maximum time exceeded before throwing an "ElementNotVisibleException" exception.

The fluent wait is used to tell the web driver to wait for a condition, as well as the frequency with which we want to check the condition before throwing an "ElementNotVisibleException" exception.

0 comments:

Post a Comment