While automating web application Selenium Webdriver Implicit wait is applied to all findElement and findElements keyword till the element is visible. But in some case we need to check if fields visibility immediately on performing some actions. So why to wait for default implicit wait of 15 or 30 seconds.
Here is the simple tip to override Implicit default wait time by Turning OFF the implicit wait while performing action and validating field visibility. Below Java code snippet will be helpful -
After verifying the step turn ON default implicit wait as below -
Here is the simple tip to override Implicit default wait time by Turning OFF the implicit wait while performing action and validating field visibility. Below Java code snippet will be helpful -
public void turnOFFImplicitWait(Webdriver driver) {
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
}
After verifying the step turn ON default implicit wait as below -
public void turnONImplicitWait(Webdriver driver) {
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}