Hi,
I am new to selenium and I have a query. While working on a hotel booking website called "Trivago.com", I entered a city in the search box and several options appeared as a drop down list. Can you suggest, how can I pick up one of these options and then select the search button? Here's the code that I have written so far. It types the name in the search box but doesn't select the option. Please guide.
System.setProperty("webdriver.chrome.driver", "C:\\Selenium Drivers\\chromedriver_win32\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("
http://www.trivago.com");
System.out.println(driver.getTitle());
driver.findElement(By.id("js_querystring")).sendKeys("Tampa");//alternate way of doing
driver.findElement(By.xpath(".//*[@id='js-dealform-suggest']/ul/li[1]/div[2]/span[1]/strong")).click();
driver.findElement(By.xpath(".//*[@id='js_go']")).click();
The page I am working on is "
http://www.trivago.com/".