Implicit Wait sets a default timeout for the WebDriver to poll the DOM repeatedly until an element is found, before throwing NoSuchElementException.
How to set:
Java
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
How it works:
- ✓You call
driver.findElement(By.id("btn")) - ✓WebDriver polls the DOM for up to 10 seconds
- ✓If found before 10s → proceeds immediately
- ✓If not found in 10s → throws
NoSuchElementException
Key characteristics:
- ✓Set once per driver session — applies globally
- ✓Polls at approximately 500ms intervals
- ✓Applies only to
findElement()andfindElements() - ✓Does NOT work with
ExpectedConditions
Example:
Java
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
driver.get("https://automateqa.online");
WebElement el = driver.findElement(By.id("result")); // Waits if not immediately available
Warning: Mixing implicit and explicit waits can cause unpredictable wait times. Choose one strategy per project.
