Selenium WebDriver 4

Add a reusable waits helper

Hard120 pts~45 min
  • Explicit waits
  • Helpers
  • Synchronisation
Practice app · Order Tracker

Asynchronous UI that appears, changes and disappears on timers — for explicit, implicit and fluent waits.

Test URL
/lab/qa-automation-add-a-reusable-waits-helper

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Wrap explicit waits in a small reusable helper and use it to synchronise with the order tracker's asynchronous UI.

Your task

  1. 1Create a Waits helper with waitForVisible(locator), waitForClickable(locator), waitForText(locator, text) and waitForInvisible(locator), sharing one timeout.
  2. 2Wait for #page-loader to disappear, then click #load-status.
  3. 3waitForText(#order-status, “Shipped”) and assert it.
  4. 4waitForClickable(#delayed-button), click it and assert #delayed-result reads “Clicked after wait”.

Acceptance criteria

  • A reusable waits helper is used
  • No fixed sleeps
  • #order-status and #delayed-result show the expected texts
  • At least 2 assertions pass

Constraints

  • Do not use fixed sleeps — synchronise with explicit waits.

Selenium WebDriver 4 · QA Automation · Page Object Model & architecture