Selenium WebDriver 4

Find an element by tag name

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

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

Test URL
/lab/selenium-find-an-element-by-tag-name

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

Objective

Use tag names to read the page heading and count the product cards.

Your task

  1. 1Open TEST_URL.
  2. 2Find the h1 by tag name and assert its text is “Test gear catalog”.
  3. 3Find all article elements by tag name and assert there are 3.

Acceptance criteria

  • Elements are located with By.tagName
  • 3 product cards are displayed
  • At least 2 assertions pass

Selenium WebDriver 4 · Selenium · Locators & the DOM