Selenium WebDriver 4

Read the current URL and assert it

Easy30 pts~12 min
  • Current URL
  • Navigation
Practice app · TargetQA Practice Store

A small storefront landing page for browser setup, navigation, titles, URLs and screenshots.

Test URL
/lab/qa-automation-read-the-current-url-and-assert-it

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

Objective

Navigate inside the app and assert the browser’s current URL reflects the new route.

Your task

  1. 1Open TEST_URL and assert the current URL starts with TEST_URL.
  2. 2Click the “Products” link #nav-products.
  3. 3Assert the current URL ends with “#/products”.
  4. 4Assert #current-route shows “/products”.

Acceptance criteria

  • The test reads the current URL
  • The final URL contains “#/products”
  • #current-route shows “/products”
  • At least 2 assertions pass

Selenium WebDriver 4 · QA Automation · Setup & first script