Selenium Java - Handling Form Elements
How do you select the option at index 1 (second option) from a dropdown using Selenium Java's
Select class?Select class?Select starts at 0, so index 1 is the second option.selectByIndex(1) selects the second option; selectByValue(1) looks for value="1"; selectByVisibleText("1") looks for visible text "1"; selectByIndex(2) selects third option.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions