Google News
logo
Selenium - Interview Questions
What are the types of waits supported by WebDriver?
Implicit wait : Implicit wait commands Selenium to wait for a certain amount of time before throwing a “No such element” exception.
 
driver.manage().timeouts().implicitlyWait(TimeOut, TimeUnit.SECONDS);


Explicit wait : Explicit wait is used to tell the Web Driver to wait for certain conditions before throwing an "ElementNotVisibleException" exception.
 
WebDriverWait wait = new WebDriverWait(WebDriver Reference, TimeOut);


Fluent wait : It 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.
 
Wait wait = new FluentWait(WebDriver reference).withTimeout(timeout, SECONDS).pollingEvery(timeout, SECONDS).ignoring(Exception.class);
Advertisement