Implict Vs Explicit Wait in Selenium

Wait is an important term while writing automated Test Scripts using Selenium as some Web Elements might not be clickable while performing actions on them or they might take some time to load. 

We might get runtime errors like:
org.openqa.selenium.WebDriverException: Element is not clickable at point. Other element would receive the click.
We widely use two kinds of Wait in Selenium:  Implicit Wait and Explicit Wait.
Implict Vs Explicit Wait in Selenium
Implicit Wait 
Implicit wait waits for a certain defined period of time. Example in below code snippet.

Explicit Wait 
Explicit Wait is far better than Implicit Wait as it waits for any Web Element which does not load due to Ajax or JavaScript calls on webpage. 

Sample Common Functions to be used for Implicit & Explicit Wait:

Post a Comment