Error with List <WeElement> - The type List is not generic; it cannot be parameterized with arguments <WebElement>
This should be pretty basic, but I need help.
List <WebElement> options = driver.findElements(By.tagName("option"));
Error: The type List is not generic; it cannot be parameterized with arguments <WebElement>
Re: Error with List <WeElement> - The type List is not generic; it cannot be parameterized with arguments <WebElement>
This post was updated on .
Solution - import java.awt.List;
The issue has nothing to do with driver.close().
I changed the code like below, still got issue.
I am also trying to fix, but did not understand the cause. Any imports / variable declarations ??
Is the syntax correct?
Thread.sleep(11111);
System.out.print("finished");
List <WebElement> options = driver.findElements(By.tagName("option"));
for (WebElement option : options)
{
if (valToBeSelected.equalsIgnoreCase(option.getText())){
option.click(); }
}
driver.close();