Locate a nested element from a parent
Medium70 pts~25 min
- Scoped search
- WebElement
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
Find a product card first, then search only inside it.
Your task
- 1Open TEST_URL and find the card
[data-testid='product-tqa-300']. - 2From that card element, find
.product-priceand assert it is “$49.00”. - 3From the same card, find
.add-to-cartand click it. - 4Assert
#cart-countshows “1”.
Acceptance criteria
- findElement is called on a parent element
#cart-countshows “1”- At least 2 assertions pass
Selenium WebDriver 4 · QA Automation · Locators & the DOM