Careeroza
Implicit Wait
One Setting for All findElement Calls
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
driver.findElement(By.id("login-btn")).click();
driver.findElement(By.id("welcome")).getText(); // retries for up to 10 s until the element exists- Set once after creating the driver; applies to every
findElement/findElements. - It only waits for an element to be present in the DOM, not visible or clickable.
findElementswaits the full 10 s before returning an empty list, which makes "is it absent?" checks slow.
Other Timeouts
| Timeout | Code | Default |
|---|---|---|
| Page load | timeouts().pageLoadTimeout(Duration.ofSeconds(30)) | 300 s |
| Async script | timeouts().scriptTimeout(Duration.ofSeconds(20)) | 30 s |
| Implicit | timeouts().implicitlyWait(Duration.ofSeconds(10)) | 0 s (off) |