Selenium WebDriver 4

Add two units of a product to the cart

Easy30 pts~2 min
  • Navigation
  • Dropdowns
  • State changes
Practice app · ShopZone

A full marketplace: two-step sign-in, search with filters and sorting, product pages with tabs, a cart with coupons, and checkout.

Test URL
/lab/selenium-shopzone-add-to-cart

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

Objective

Open the Nimbus X2 Wireless Headphones product page, choose a quantity of 2, add it to the cart and verify the cart badge.

Your task

  1. 1Open TEST_URL and open the Nimbus X2 Wireless Headphones from Today's Deals (or search for it).
  2. 2Select 2 in the Quantity dropdown (#quantity-select).
  3. 3Click Add to Cart (#add-to-cart).
  4. 4Assert the cart badge #cart-count shows 2.

Acceptance criteria

  • The cart badge shows 2 items.
  • The test asserts the badge value.

Fixtures

Email
buyer@shopzone.test
Password
Shop@123
Account name
Asha Verma
Coupon
SAVE10 (10% off the subtotal)
Pincodes
560001 Bengaluru · 110001 New Delhi · 400001 Mumbai · 600001 Chennai

Selenium WebDriver 4 · Selenium Challenges · ShopZone