Selenium WebDriver 4

Select an option by visible text

Medium70 pts~25 min
  • Select
  • Dropdowns
Practice app · Workshop Registration

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

Test URL
/lab/qa-automation-select-an-option-by-visible-text

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

Objective

Choose a country from a native select using its visible label.

Your task

  1. 1Open TEST_URL.
  2. 2Wrap #country in the Select helper (Select / SelectElement).
  3. 3Select “India” by visible text.
  4. 4Assert the first selected option’s text is “India”.

Acceptance criteria

  • The option is selected by visible text
  • #country value is “in”
  • At least 1 assertion passes

Selenium WebDriver 4 · QA Automation · Forms & inputs