This blog is for Automation Test Engineers

Friday 16 March 2018

How to handle Autosuggestion in selenium

Webdriver driver =new FirefoxDriver();
driver.get("https://www.google.co.in");
WebElement searchbox=driver.finElement(By.name("q")).senkeys("selenium"));
List<WebElement>autosugg=driver.findElement(By.xpath("//div[contains(text(),'selenium')]
for(int i=1;i<autosugg.size();i++){

System.out.println(autosugg.get(i).getText());
}
0

0 comments:

Post a Comment