Selenium WebDriver 4

Read the page title and assert it

Easy30 pts~12 min
  • Page title
  • Assertions
Practice app · TargetQA Practice Store

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

Test URL
/lab/selenium-read-the-page-title-and-assert-it

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

Objective

Read document.title through WebDriver and assert it exactly.

Your task

  1. 1Open TEST_URL.
  2. 2Read the title (getTitle(), driver.title, driver.Title).
  3. 3Assert it equals “TargetQA Practice Store”.
  4. 4Click #nav-products and assert the title is unchanged.

Acceptance criteria

  • The test reads the page title
  • The final page title contains “TargetQA Practice Store”
  • At least 2 assertions pass

Selenium WebDriver 4 · Selenium · Setup & first script