Selenium Java - Handling Form Elements
Given the following code:
What will be printed if the dropdown options have values: apple, banana, cherry?
WebElement dropdown = driver.findElement(By.name("fruits"));
Select select = new Select(dropdown);
select.selectByValue("banana");
System.out.println(select.getFirstSelectedOption().getAttribute("value"));What will be printed if the dropdown options have values: apple, banana, cherry?
