Selenium Java - Handling Form Elements
What will be the output of the following code snippet?
Assuming the dropdown options are: 0: Red, 1: Green, 2: Blue, 3: Yellow
WebElement dropdown = driver.findElement(By.id("colors"));
Select select = new Select(dropdown);
select.selectByIndex(2);
System.out.println(select.getFirstSelectedOption().getText());Assuming the dropdown options are: 0: Red, 1: Green, 2: Blue, 3: Yellow
