The problem every Selenium team hits
Your test suite was green last week. Today it's failing on 12 tests. The error is always the same:
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.cssSelector: #submit-btn
Enter fullscreen mode
Exit fullscreen mode
You open the app. The button is right there. You inspect it — the id changed from submit-btn to btn-submit . A frontend developer renamed it during a refactor and didn't tell QA.
This is the #1 cause of flaky, high-maintenance Selenium suites. Locators are brittle by nature. The moment the DOM changes, your tests break — even when the feature itself works perfectly.
The standard advice is "use better locators" (data-testid, aria labels). Good advice.…