Selenium WebDriver 4

Navigate the photo gallery dialog

Easy30 pts
  • Modals
  • Keyboard input
  • Dynamic text
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-photo-gallery

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

Objective

Open the photo tour of Casa Azulejo, step through it with Next and Previous, close it with Escape and reopen it on the third photo.

Your Task

  1. 1Open TEST_URL and open Casa Azulejo · Alfama Townhouse from Featured stays ([data-testid="listing-card"][data-listing-id="casa-azulejo"] .listing-title).
  2. 2Click “Show all 8 photos” (#show-photos) and wait for the dialog #gallery-modal.
  3. 3Assert #gallery-counter reads “1 / 8” and Previous (#gallery-prev) is disabled.
  4. 4Click Next (#gallery-next) three times and Previous once; assert #gallery-counter reads “3 / 8” and #gallery-caption reads “Kitchen”.
  5. 5Press Escape and assert the dialog is closed.
  6. 6Click the third photo tile ([data-testid="photo-tile"][data-photo-index="3"]) and assert the gallery reopens at “3 / 8”.

Validation Checks

  • The gallery dialog is open.
  • It shows photo 3 of 8, captioned “Kitchen”.
  • The test asserts the counter and the dialog closing.

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 3 acceptance checks and earn 30 points.

Selenium WebDriver 4 · Selenium Challenges Practice Track · StayNest