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.
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
- 1Open TEST_URL.
- 2Find the
h1by tag name and assert its text is “Test gear catalog”. - 3Find all
articleelements 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