Overview

The SELECT step allows you to select options from native HTML select elements (dropdowns). It supports selecting by value, visible text, or index, and provides helpful error messages with available options when selection fails.

Parameters

targetDescription
string
required
Select element selector. Must target a native HTML select element.
selectionMethod
enum
default:"value"
How to select the option:
  • value - Select by option value attribute
  • text - Select by visible option text
  • index - Select by option index (0-based)
optionValue
string
The option value attribute (used when selectionMethod is “value”)
optionText
string
The visible option text (used when selectionMethod is “text”)
optionIndex
number
The option index, starting from 0 (used when selectionMethod is “index”)
waitForChange
boolean
default:"true"
Wait for the change event after selection

Behavior

  1. Element Location: Finds the select element using the selector
  2. Element Validation: Validates it’s a native SELECT element
  3. Option Finding: Locates the option based on the selection method
  4. Selection: Updates the selected option
  5. Event Firing: Fires change and input events
  6. Change Wait: Optionally waits for change event processing

Common Use Cases

  • Selecting countries, states, or cities
  • Choosing product options (size, color, etc.)
  • Setting sort order or filters
  • Selecting dates (month/year dropdowns)
  • Choosing from predefined lists

Error Handling

The step will fail if:
  • The element cannot be found
  • The element is not a native SELECT element
  • The specified option doesn’t exist
  • The select element is disabled
When an option cannot be found, the error message includes a list of all available options to help with debugging.