Selenium WebDriver 4

Test a dynamic product grid

Hard120 pts~45 min
  • Dynamic content
  • Explicit waits
  • API-driven UI
Practice app · Gear Shop

A product grid loaded from a real API with search, filters, infinite scroll and a checkout that calls a payments API.

Test URL
/lab/selenium-test-a-dynamic-product-grid

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

Objective

Wait for the API-driven product grid to load, filter it by category and verify the re-rendered tiles.

Your task

  1. 1Wait until #results-count reads “12 products” and 8 .product-tile elements are shown (8 per page).
  2. 2Select “cameras” in #category-filter.
  3. 3Wait for the grid to re-render: #loading-indicator gone and #results-count “3 products”.
  4. 4Assert exactly 3 tiles, each with data-category="cameras", including “Action Camera 4K” in .tile-name.

Acceptance criteria

  • #category-filter is set to cameras
  • #results-count shows “3 products” with 3 tiles
  • At least 3 assertions pass

Constraints

  • Do not use fixed sleeps — synchronise with explicit waits.

Selenium WebDriver 4 · Selenium · Tables & dynamic content