Selenium Java - Handling Form Elements
Identify the error in the following code snippet that tries to select an option by visible text:
Assume the dropdown is not a
WebElement dropdown = driver.findElement(By.name("fruits"));
Select select = new Select(dropdown);
select.selectByVisibleText("Apple");Assume the dropdown is not a
<select> element but a custom div-based dropdown.