select_option
Choose an option in a native dropdown by visible text, value, or zero-based index; waits for visibility and clicks it so change events fire, adding on multi-select.
Instructions
Select an option in a native dropdown by visible text, value, or zero-based index, and return the resulting selection. Waits for the dropdown to be visible, then clicks the option like a user so change events fire; on a multi-select it adds to the current selection. If nothing matches, the error lists the available options so you can retry. Only for real elements; for custom dropdowns built from other elements, click the trigger and then the option.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element ref from capture_page (e.g. 'e12') pointing at the <select>. Use instead of selector. | |
| text | No | Visible text of the option to select, matched exactly after trimming (e.g. 'Canada'). Provide exactly one of text, value, or index. | |
| index | No | Zero-based position of the option, counting every <option> including placeholders like 'Choose...'. Provide exactly one of text, value, or index. | |
| value | No | The option's value attribute (e.g. 'ca'). Provide exactly one of text, value, or index. | |
| selector | No | Locator for the <select> element, e.g. { by: 'id', value: 'country' }. Provide either selector or ref. | |
| timeoutMs | No | How long to wait for the dropdown to become visible, in milliseconds (default 10000). |