Selenium WebDriver 4

Switch the results from list to map view

Easy30 pts
  • Tabs
  • View toggles
  • Data attributes
Practice app · StayNest

A home-sharing marketplace: destination autocomplete, a two-month date-range calendar, a guests popover with steppers, results with a list/map toggle and a filters modal, listing pages with a photo gallery, a reserve card with a price breakdown, host profiles in a new tab, a wishlist that needs sign-in and a message-host form.

Test URL
/lab/selenium-staynest-list-map-toggle

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

Objective

Open the Kyoto stays, switch from the list to the map view, and preview a stay by clicking its price pin.

Your Task

  1. 1Open TEST_URL and open Kyoto from “Inspiration for your next trip” ([data-testid="destination-tile"][data-destination="kyoto"]).
  2. 2Assert the List tab (#view-list) is selected and 4 listing cards are shown.
  3. 3Click the Map tab (#view-map); assert #results-map shows 4 price pins ([data-testid="map-pin"]) and the URL contains layout=map.
  4. 4Click the $265 pin of Gion Machiya Townhouse ([data-testid="map-pin"][data-listing-id="kyoto-machiya"]).
  5. 5Assert #map-preview shows “Gion Machiya Townhouse”.

Validation Checks

  • The Map tab is selected and the map shows 4 price pins.
  • The URL records layout=map.
  • The preview card shows Gion Machiya Townhouse.
  • The test makes at least two assertions.

Fixtures

Email
guest@staynest.test
Password
Nest@2026
Account name
Jordan Lee
Today
Tuesday, 10 November 2026 (earlier days are disabled)
Destinations
Goa · Lisbon · Kyoto · Banff · Cape Town
Service fee
14% of the nightly subtotal
Guest limits
Adults 1–16 (adults + children ≤ 16) · infants up to 5 · pets up to 5
Host verification code
Shown only on the host profile tab

Cloud Execution & Grading Guide

This Easy Selenium Challenges exercise runs inside TargetQA's managed cloud sandbox using Selenium WebDriver 4 (Java, Python, C#). Every submission runs inside an isolated headless Chromium container with pre-synced drivers, capturing live console logs, DOM assertions, and a 720p step-by-step video replay.

  • Supported stacks: Java (Selenium 4 + JUnit 5) · Python (Selenium 4 + pytest) · C# (Selenium 4 + NUnit)
  • Zero local setup: Use the pre-declared TEST_URL variable so your script targets the live StayNest sandbox reliably without hardcoding hosts.
  • Automated grading: Click Run to inspect step logs and behavior, then click Submit to validate all 4 acceptance checks and earn 30 points.

Selenium WebDriver 4 · Selenium Challenges Practice Track · StayNest