Selenium WebDriver 4

Wait for the URL to change

Medium70 pts~25 min
  • Explicit waits
  • Navigation
Practice app · Order Tracker

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

Test URL
/lab/selenium-wait-for-the-url-to-change

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

Objective

Wait for a delayed client-side redirect before asserting the new page.

Your task

  1. 1Open TEST_URL and click #go-next (it redirects after about 1.5 s).
  2. 2Wait until the URL contains “#/next”.
  3. 3Assert #next-heading reads “Next page”.

Acceptance criteria

  • A URL condition is used
  • The final URL contains “#/next”
  • #next-heading reads “Next page”
  • 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