Does WebDriverWait ignore StaleElementReferenceException by default?
0 reputation · 22 Jan 2026, 11:36 UTC
Handling DOM Instability with Explicit Waits
In dynamic web applications, elements are frequently detached and re-attached to the DOM during asynchronous updates. When using Selenium's WebDriverWait in conjunction with ExpectedConditions, the polling mechanism is designed to handle certain transient failures without immediately failing the test.
There is a need to clarify how the internal polling loop treats specific exceptions. While some exceptions might trigger an immediate timeout or failure, others may be silently ignored to allow the driver to attempt to relocate the element in the next poll cycle.
What is the default behavior of WebDriverWait when a StaleElementReferenceException is thrown during a polling interval? Does this mechanism apply to all ExpectedConditions, or must specific exceptions be explicitly added to the ignore list via ignoring()?