Selenium WebDriver 4

Validate the mobile number on sign-up

Medium50 pts~2 min
  • Form validation
  • Negative testing
  • Field errors
Practice app · StyleKart

A fashion store with Men, Women and Kids listings: multi-select filters with removable chips, a custom sort listbox, load-more paging, product pages with colour swatches, sizes, a size-chart modal and a hover gallery, a wishlist, a bag with per-line sizes and a coupons modal, sign-up validation and checkout.

Test URL
/lab/selenium-stylekart-signup-mobile

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

Objective

Submit the sign-up form with a mobile number that starts with 5, verify the field-level error, then correct the number and verify the account is created.

Your task

  1. 1Open TEST_URL and click Sign up (#nav-profile).
  2. 2Fill #signup-name with “Priya Sharma”, #signup-mobile with 5123456789, #signup-email with priya.sharma@example.com and #signup-password with Style@2026.
  3. 3Click Create account (#signup-submit) and assert #signup-mobile-error says the number must start with 6, 7, 8 or 9, and that no email or password error is shown.
  4. 4Replace the mobile number with 9123456780 and submit again.
  5. 5Assert #signup-success welcomes Priya, shows +91 9123456780, and the header #nav-profile reads “Hi, Priya”.

Acceptance criteria

  • The invalid mobile number was rejected with a field-level error.
  • The account is created for 9123456780.
  • The header greets Priya.
  • The test makes at least two assertions.

Fixtures

Coupons
STYLE20 (20% off bags of ₹1,999 or more) · FIRST100 (₹100 off)
Valid mobile
10 digits starting with 6, 7, 8 or 9, e.g. 9123456780
Password rules
8+ characters with an uppercase letter, a number and a special character, e.g. Style@2026
Seeded bag
Floral Wrap Midi Dress (Pink, S) ×1 · Essential Crew Neck T-Shirt (Black, M) ×2 · Square Neck Crop Top (White, S) ×1
Delivery address
Rohan Mehta · 9876543210 · 400001 · Flat 12, Sea View Apartments · Mumbai · Maharashtra

Selenium WebDriver 4 · Selenium Challenges · StyleKart