Playwright

Understand strictness and resolve it

Hard120 pts
  • Strict Mode
  • Ambiguous Locators
  • Resolution
  • Scoping
Practice app · Practice Catalog

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

Test URL
/lab/playwright-understand-strictness-and-resolve-it

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

Objective

Resolve Playwright's strict mode violation when an action locator matches multiple elements on the page.

Your Task

  1. 1Navigate to the practice catalog page at TEST_URL.
  2. 2Observe that multiple product cards contain a 'View details' link (.details-link).
  3. 3Target and click the first 'View details' link using a strategy that resolves strictness (such as selecting the first match or scoping to a card).
  4. 4Assert that the product details section (#product-detail) is visible on the page.

Validation Checks

  • Practice catalog application is loaded at TEST_URL
  • Strict mode is resolved when targeting 'View details' links (.details-link)
  • First 'View details' link is clicked
  • Product details section (#product-detail) is displayed
  • At least 1 assertion passes

Playwright · Playwright Practice Track · Locators & auto-waiting