Skip to main content

Get Select Options

Retrieves all available options from a dropdown (select) element as an array of text values.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing the node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If Continue On Error property is true, no error is caught when the project is executed, even if the Catch node is used.

Input

  • Browser ID - The browser session identifier from the Open Browser node.
  • Selector - The XPath or CSS selector to locate the select dropdown element.

Output

  • Options - Array of text values from all options in the dropdown, in the order they appear.

Options

  • Selector Type - Type of selector used:

    • XPath - Use XPath expression (default)
    • CSS - Use CSS selector
  • Wait Timeout (sec) - Maximum time to wait for the select element to appear. Default is 5 seconds.

Examples

Get All Options

Browser ID: {{browser_id}}
Selector: //select[@name='country']
Output: {{countries}}

Result: ["United States", "Canada", "Mexico", ...]

Loop Through Options

1. Get Select Options node:
Browser ID: {{browser_id}}
Selector: //select[@id='categories']
Output: {{options}}

2. For Each loop with {{options}}
- Process each option

Check if Option Exists

1. Get Select Options node:
Browser ID: {{browser_id}}
Selector: //select[@name='city']
Output: {{cities}}

2. Condition: if {{cities}} contains "New York"

Dynamic Option Selection

1. Get Select Options node:
Browser ID: {{browser_id}}
Selector: //select[@id='year']
Output: {{years}}

2. Select first option:
Visible Text: {{years[0]}}

Tips

  • Use to validate available options before selecting
  • Helpful for dynamic dropdowns where options change
  • Returns text values, not option values
  • Empty select elements return an empty array
  • Use in conditional logic to handle different option sets
  • Combine with loops to process all options

Common Errors

  • "Browser ID cannot be empty" - Connect to an Open Browser node
  • "Selector cannot be empty" - Provide an XPath or CSS selector for the select element
  • "Select element not found within X seconds" - The select element doesn't exist or takes longer to load
  • "Timeout cannot be empty" - Provide a timeout value