-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Open
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!I-enhancementSomething could be betterSomething could be better
Description
Description
Feature Request: Improve WebDriverWait
TimeoutException Message with Detailed Context
Context
Given that WebDriverWaitis heavily relied upon for synchronisation and a wait condition fails, the resulting
TimeoutException` often lacks sufficient context to understand what exactly went wrong. This slows down root cause analysis during triaging.
Suggestion
It would be helpful to enhance the exception message thrown by WebDriverWait
when a condition times out. Specifically, include:
- The expected condition (via
.toString()
) - The total timeout duration
- The locator (where applicable)
This added context can help quickly identify the exact point of failure without having to dig into logs or source code.
Example
Current:
Timed out waiting for condition.
Proposed:
Timed out after 10 seconds waiting for condition: visibility of element located by By.id("login")
Why This Matters
- This is a small, backward-compatible improvement with high practical value
- Helps quickly debug flaky or failing tests.
Iβd be happy to raise a PR for this enhancement, if this sounds useful.
Have you considered any alternatives or workarounds?
No response
Metadata
Metadata
Assignees
Labels
A-needs-triagingA Selenium member will evaluate this soon!A Selenium member will evaluate this soon!I-enhancementSomething could be betterSomething could be better