I want to select the first option showing in an autocomplete text box. Below is the code which i tried but not getting the required output.
Code:
public void clickSublink() throws IOException, InterruptedException {
System.setProperty("webdriver.chrome.driver","F:\\Amitha\\chromedriver.exe");
WebDriver dr=new ChromeDriver();
dr.get("http://demoqa.com/autocomplete/");
dr.findElement(By.xpath("//input[@id='tags']")).sendKeys("b");
dr.findElement(By.xpath("//ul[@id='ui-id-1']//child::li")).click();
}