select_by_index
The command to select an <option> by its index within a <select> dropdown element.
Syntax
Usage
Arguments
index (int)
- The index or "position" of the option to select.
Yields
Element - The current instance of Element so you can chain commands.
Examples
Given this HTML
We can select any of the options
See also
click() - If the dropdown is NOT a <select> element,
.click()
will work
Last updated