Select Dropdown by Index
Select by position using selectOption({ index: n }). Index is 0-based.
The singleSelect dropdown options:
- Index 0: "Select Language" (disabled placeholder)
- Index 1: "Java"
- Index 2: "Python"
- Index 3: "JavaScript"
- Index 4: "C#"
- Index 5: "Ruby"
Task:
- Navigate to
https://testkru.com/Elements/Dropdowns - Select the option at index 3 (JavaScript)
- Print the selected text
Expected output:
Selected at index 3: JavaScript
TestKru