Whenever I'm using this code:
driver.findElement(By.xpath("//*[@id='gbwa']/div[1]/a")).click();
its navigating to "products" page. but I want the dropdown list in the homepage itself to select youtube. I have also tried that process:
List<WebElement> li=driver.findElements(By.cssSelector(".gb_ia"));
WebElement r=driver.findElement(By.cssSelector("#gb36 > span.gb_3"));
for(WebElement option:li){
if(option.equals(r)){
option.click();
break;
}
}
Its also not working. Help plz...