Selenium WebDriver 4

Find an element by ID

Easy30 pts~12 min
  • Locators
  • By.id
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-id

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

Objective

Locate the search field and button by their ids and run a search.

Your task

  1. 1Open TEST_URL.
  2. 2Find search-input by id and type “mug”.
  3. 3Find search-button by id and click it.
  4. 4Assert #search-summary contains “mug”.

Acceptance criteria

  • Elements are located with By.id
  • #search-summary mentions “mug”
  • At least 1 assertion passes

Selenium WebDriver 4 · QA Automation · Locators & the DOM