Playwright

Select from a dropdown

Easy30 pts
  • selectOption
  • Dropdowns
  • Multi-select
Practice app · Workshop Registration

A registration form with text fields, radios, checkboxes, selects and validation.

Test URL
/lab/playwright-select-from-a-dropdown

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

Objective

Select an option from a single-select and multi-select dropdown element and verify the selections.

Your Task

  1. 1Navigate to the preferences form at TEST_URL.
  2. 2Select 'India' (value 'in') from the country dropdown (#country).
  3. 3Assert that the country dropdown (#country) has selected value 'in'.
  4. 4Select options 'Java' (value 'java') and 'CI/CD' (value 'cicd') in the skills multi-select dropdown (#skills).
  5. 5Assert that the skills dropdown (#skills) has selected values ['java', 'cicd'].

Validation Checks

  • Preferences form is loaded at TEST_URL
  • Country dropdown (#country) has selected value 'in'
  • Skills multi-select dropdown (#skills) has selected values ['java', 'cicd']
  • At least 1 assertion passes

Playwright · Playwright Practice Track · Actions & inputs