It is not printing all the values from drop down. It is printing values up to the element that I'm making it to click on and printing blank for rest of the values.
driver.get("https://some-url.com");
driver.findElement(By.xpath("//*[@id='example']/div[4]/div/div[2]/div[4]/div[1]/div[6]/div/input[2]")).click();
List<WebElement> allOptions = driver.findElements(By.xpath("//div[@class='menu transition visible']/div"));
for (int i = 0; i < allOptions.size(); i++) {
System.out.println(allOptions.get(i).getText());
if (allOptions.get(i).getText().equalsIgnoreCase("Angola")) {
allOptions.get(i).click();
}
}
I expect my code to print all the values from drop down but it is actually printing values up to the element that I'm making it to click.