Selenium WebDriver 4

Find an element by partial link text

Easy30 pts~12 min
  • Locators
  • By.partialLinkText
Practice app · Practice Catalog

A product catalog with ids, names, classes, links, data-testids and duplicate buttons for locator practice.

Test URL
/lab/qa-automation-find-an-element-by-partial-link-text

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

Objective

Follow a link using only part of its visible text.

Your task

  1. 1Open TEST_URL.
  2. 2Find the link whose text contains “Shipping” (the footer “Shipping policy” link) and click it.
  3. 3Assert the current URL ends with “#/shipping”.

Acceptance criteria

  • The link is located with By.partialLinkText
  • The final URL contains “#/shipping”
  • At least 1 assertion passes

Selenium WebDriver 4 · QA Automation · Locators & the DOM