I am trying to get all the elements from a dropdown menu using the following code:
List<WebElement> actmenu = driver.findElements(By.className("mbrMenuItems"));
for (int i = 0; i < actmenu.size(); i++) {
System.out.println(actmenu.get(i).getText());
}
actmenu.get(0).click();
actmenu.get(1).click();
So, I am able to print the link text using the for loop but I am not able to click on the elements, throws the following error:
Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with Command duration or timeout: 30.31 seconds
any help in solving this error?