Complete the code to select an option by its visible text.
Select dropdown = new Select(driver.findElement(By.id("menu"))); dropdown.selectBy[1]("Option 1");
The method selectByVisibleText selects an option by the text shown to the user.
Complete the code to select an option by its value attribute.
Select dropdown = new Select(driver.findElement(By.name("choices"))); dropdown.[1]("val2");
The method selectByValue selects an option by its value attribute.
Fix the error in the code to select an option by its index.
Select dropdown = new Select(driver.findElement(By.cssSelector("#list"))); dropdown.selectBy[1](2);
The correct method to select by position is selectByIndex.
Fill both blanks to select an option by visible text and then by index.
Select dropdown = new Select(driver.findElement(By.id("dropdown"))); dropdown.[1]("Choice 3"); dropdown.[2](1);
First select by visible text, then select by index using the correct methods.
Fill all three blanks to select options by value, visible text, and index in order.
Select dropdown = new Select(driver.findElement(By.name("options"))); dropdown.[1]("v1"); dropdown.[2]("Option 2"); dropdown.[3](0);
Use selectByValue for value, selectByVisibleText for text, and selectByIndex for position.
