When I select "option" from "select list"

Selects an option from a dropdown (<select>) element. The first argument is the option to choose; the second identifies the select list by its visible label, a #id or .class shorthand, or a bare token that is matched against the element's name attribute or id.

The option is matched by its visible text first; if no option with that exact label exists, the step retries using the option's value attribute. This means both select "Mercedes" (display text) and select "saab" (value) work. If neither matches, the step fails with hints: check the option spelling, or pass the option's value for value-based selection. For multi-select lists that must keep previous choices, use additionally select instead - this step replaces the current selection.

Accepted phrasings

When I select "option" from "select list"
When we select "option" from "select list"
And I select "option" from "select list"

Examples

When I select "Mercedes" from "Cars"
When I select "saab" from "#cars"
When I select "Mercedes" from "cars"
And we select "English" from "Language"

In a real scenario

Scenario: Check that a visitor can choose industry and country on the contact form
  Given I am an anonymous user
   When I go to "/contact-us"
    And wait
    And I select "Technology" from "industry"
    And I select "United States" from "country"
   Then the option "Technology" should be selected within the select element "[name='industry']"
    And the option "United States" should be selected within the select element "[name='country']"

Related steps

Back to Form Steps