Diagnose and fix a race condition
Hard120 pts~45 min
- Race conditions
- Flakiness
Practice app · Order Tracker
Asynchronous UI that appears, changes and disappears on timers — for explicit, implicit and fluent waits.
Your starter code already declares TEST_URL — never hardcode a host.
Objective
Fix a test that asserts a result immediately after clicking, before the app has produced it.
Your task
- 1Open TEST_URL and click
#race-button. - 2Notice that asserting
#race-resultimmediately fails — the result appears about 1.2 s later. - 3Wait for
#race-resultexplicitly. - 4Assert it contains “ETA updated”.
Acceptance criteria
- An explicit wait is used
- No fixed sleep is used
#race-resultcontains “ETA updated”- At least 1 assertion passes
Constraints
- Do not use fixed sleeps (Thread.sleep, time.sleep, Task.Delay, driver.sleep).
Selenium WebDriver 4 · Selenium · Waits & synchronization