Why are Google autosuggests not being populated with Selenium script? | Selenium Forum
P
Pravin V. Kumbhare Posted on 20/11/2020

I'm practicing Google autosuggests. My scripts runs well till entering the text in search box. On after entering, the auto suggests don't populate at all.

Here is my code (Same code is also attached herewith):

@Test
public void nullSkullAddition() throws InterruptedException {
String toEnter = "help";
String toSelect = "helping verbs";
initBrowser("Chrome");
driver.get("https://www.google.com/");
driver.findElement(By.name("q")).sendKeys(toEnter);
Thread.sleep(5000);
String value1 = driver.findElement(By.xpath("//ul[@class='erkvQe']/li[1]/div/div[2]/div[1]/span")).getText();
System.out.println(value1);
//List<WebElement> suggestions = driver.findElements(By.xpath("//ul[@class='erkvQe']/li"));
}


P
Pravin V. Kumbhare Replied on 24/11/2020

Can you have a look at this and advise me please?


A
Ashish Thakur Replied on 24/11/2020

Sorry for the delay.
It works fine for me though
List is coming.

May be google has some different settings in your area
Google also knows that selenium script has come on browser :)


Related Posts