Use CSS combinators (child and descendant)
Medium70 pts~25 min
- CSS combinators
- Scoping
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
Scope selectors with the descendant (space) and child (>) combinators.
Your task
- 1Open TEST_URL.
- 2Use the descendant selector
.product-card .add-to-cartto find all buttons and assert there are 3. - 3Use the child selector
form[role='search'] > inputto type “mug”. - 4Click
form[role='search'] > buttonand assert#search-summarycontains “mug”.
Acceptance criteria
- A child combinator (>) is used in a CSS selector
#search-summarymentions “mug”- At least 2 assertions pass
Selenium WebDriver 4 · QA Automation · Locators & the DOM