Elements

bl select

Select an option in a <select> element

Select an option in a <select> element

Usage

bl select <selector> <value> [OPTIONS]

Arguments

ArgumentDescription
&lt;selector&gt;CSS selector or @ref of the <select> element
&lt;value&gt;Value of the option to select

Options

OptionDescription
--nth <value>Select the 0-based Nth match of the selector (default: first). Mutually exclusive with --last.
--lastSelect the last match of the selector. Mutually exclusive with --nth.
--headlessHide browser window (visible by default)
--jsonOutput as JSON
--session <value>Run this command in the named session (env: BL_SESSION; default: "default")

Global options

OptionDescription
-v, --verboseEnable debug logging

Examples

bl select "select#color" "blue"
# Select "blue" in the color dropdown

bl select "select.qty" "5" --last
# Select in the last matching dropdown

On this page