Selenium WebDriver 4

Scroll an infinite listing until a product appears

Medium55 pts~2 min
  • Infinite scroll
  • Scrolling
  • Explicit waits
  • Loops
Practice app · FlipMart

An Indian electronics megastore: mobile-number + OTP login with an on-page SMS, an Electronics hover mega-menu, search autocomplete, listings with a price slider, brand filters, sort tabs and infinite scroll, a 3-product compare table, product pages with offers, pincode checks and rating breakdowns, a flash sale countdown, a login-gated wishlist, and a cart with UPI, card and Cash on Delivery checkout.

Test URL
/lab/selenium-flipmart-infinite-scroll

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

Objective

The Mobiles listing loads 12 phones at a time as you scroll. Keep loading until Zenph Fold Z 5G (only on page 3) appears, then verify it is shown.

Your task

  1. 1Open TEST_URL and open the Mobiles listing. #result-count reads “(Showing 1 – 12 of 30 results)”.
  2. 2Scroll the sentinel at the bottom of the list (#load-sentinel) into view. A spinner (#loading-more) appears and the next 12 cards are added.
  3. 3Repeat until the card [data-testid="product-card"][data-product-id="zenph-fold-z"] exists, waiting for each batch rather than sleeping.
  4. 4Scroll that card into view and assert that it shows the price ₹1,39,999 and that #result-count reads “30 of 30”.

Acceptance criteria

  • The Zenph Fold Z 5G card is visible.
  • At least 25 cards have been loaded.
  • The result count reports 30 of 30.
  • The test uses no fixed sleeps.

Fixtures

Mobile number
9876543210
OTP
482913 (also shown in the on-page SMS)
Account name
Rohan Mehta
UPI ID
rohan@fmupi
Saved address
221B, 12th Main Road, Indiranagar, Bengaluru - 560038
Pincodes
560001 / 560038 Bengaluru · 110001 New Delhi · 400001 Mumbai · 600001 Chennai · 700001 Kolkata · 500001 Hyderabad
Today
Tuesday, 10 November 2026

Selenium WebDriver 4 · Selenium Challenges · FlipMart