I'm just trying one string in search box like "testing" and then wait for the list of search option is visible and then printing the count of visible list.but getting 0 count. Below is the code that I'm using.
driver.get("https://www.google.com/");
driver.findElement(By.xpath("//input[@class=\"gLFyf gsfi\"]")).sendKeys("testing");
WebElement wait = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.className("UUbT9")));
List<WebElement> search_List=driver.findElements(By.xpath("//*[@role=\'listbox\']/li/div//span"));
System.out.println(search_List.size());
for(WebElement we:search_List) {
System.out.println(we.getText());
if(we.getText().contains("testing types")) {
we.click();
break;
}
}