Selenium Java - Handling Form Elements
Identify the error in the following Selenium Java code for selecting an auto-complete option:
driver.findElement(By.id("searchBox")).sendKeys("Ban");
List options = driver.findElements(By.cssSelector("ul.suggestions li"));
for (WebElement option : options) {
if (option.getText().equals("Banana")) {
option.click();
}
} 