Selenium WebDriver 4

Handle a searchable autocomplete

Hard120 pts~45 min
  • Autocomplete
  • Dynamic lists
Practice app · UI Widgets Lab

Native alerts, confirm and prompt dialogs, a modal, a cookie banner, custom dropdown, autocomplete, date picker and tooltip.

Test URL
/lab/selenium-handle-a-searchable-autocomplete

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

Objective

Type a partial city, wait for suggestions and pick the right one.

Your task

  1. 1Open TEST_URL and type “Bo” into #autocomplete-input.
  2. 2Wait for #autocomplete-list li suggestions and assert both “Boston” and “Lisbon” appear.
  3. 3Click the suggestion “Lisbon”.
  4. 4Assert #autocomplete-result reads “Selected: Lisbon” and the input value is “Lisbon”.

Acceptance criteria

  • #autocomplete-input holds “Lisbon”
  • #autocomplete-result reads “Selected: Lisbon”
  • At least 2 assertions pass

Selenium WebDriver 4 · Selenium · Dropdowns, alerts & popups