Select action

Use the Select (selectOption) action to select options within a <select> element on the page. This action takes both text and index values to determine each option to select.

The following properties are stored within this action:

target

The selection field with which the script needs to interact.

textValues

An array of string values of the options to select. You can enter a single value, or enter multiple values if interacting with a multi-select menu. The agent first looks at the text values to see if there are elements that match; if it does not find a match, it will look at the optionIndexes array. Note that both textValues and optionIndexes are arrays; multiple values can be selected by using comma-separated values.

optionIndexes

An array that contains index values for the position(s) of the requested option(s). If the playback agent fails to locate an element by the text value, it uses the index instead.

suppressEvents

Optional property that, when enabled, tells the agent not to fire the change event for that particular select element.

Browser Agent implementation of the Select action

Locate the target element.

For each option specified:

Attempt to find the option based on the textValue. If this fails, use the optionIndex.

Perform a .click() on the option.

Set the selected attribute for the option to true.

Fire the change event, if suppressEvents is not enabled.