Skip to main content

Get drop-down list value on webpage

Sophie avatar
Written by Sophie
Updated over 2 weeks ago

Definition and Usage

This command retrieves the selected option or all options from a drop-down list element on a web page. It allows you to extract either just the currently selected value or a complete list of all available options from a dropdown menu in a web form.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Web page

Select a variable that contains the web page to work with

Yes

Must be a valid web page object

Element

Select or capture an element to operate on

Yes

Use the Capture button to select the dropdown element

Get

Specify the options to get

Selected option, All options

Yes

Selected option retrieves only the current selection; All options retrieves the complete list

Store option list into

Store the option value into a new variable

Yes

Creates a variable to store the retrieved dropdown values

Advanced settings

Parameter

Description

Possible Values

Required

Options / Notes

Element timeout (s)

Wait time for element to appear (seconds)

No

Default is 20 seconds

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This command produces an output variable that contains either the selected option value or a list of all options from the dropdown menu, depending on the "Get" parameter setting.


Using Variables in Conditions

You can use the variable produced by this command in subsequent steps of your workflow. The variable will contain either a single string (when "Selected option" is chosen) or a list of strings (when "All options" is chosen). You can reference this variable using the {variableName} syntax in other commands.


Notes

  • Before using this command, ensure that the web page is properly loaded and the dropdown element is accessible.

  • If targeting a dropdown that loads dynamically, you may need to adjust the element timeout value.

  • The element must be a proper SELECT element in HTML for this command to work correctly.

  • When retrieving "All options", the resulting variable will be a list that can be iterated through in subsequent steps.

Did this answer your question?