I am using Selenium Webdriver/Java. And I have given input "iphone" in google search box.
But I want to select "iphone 6" from the list shown by google search. How can I do that using Java/Selenium Webdriver?
How about
List<WebElement> options = driver.findElements(By.cssSelector("[role='option']"));
for (WebElement w: options)
if (w.getText().equals("iphone 6")){
w.click();
break;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.