Not able to select origin and destination in airline website

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Not able to select origin and destination in airline website

piyush jain
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class testMakemyTripSlider {

public static void main(String[] args) throws InterruptedException {

System.setProperty("webdriver.chrome.driver","C:\\PIYUSH\\Selenium\\Way2Automation\\Software\\Chrome Driver_win32\\chromedriver.exe");
WebDriver driver=new ChromeDriver();

driver.get("https://www.makemytrip.com/");
Thread.sleep(3000);
driver.findElement(By.xpath(".//*[@id='hp-widget__sTo']")).click();
driver.findElement(By.xpath(".//li[@class='ui-autocomplete-category'][@aria-label='Top Cities : Goa, India ']")).click(); 


Issue is on destination or origin as soon as I write By.xpath(".//*[@id='hp-widget__sTo']")).click();  drop down opens but now I cannot select any city from dropdown list 
using code By.xpath(".//li[@class='ui-autocomplete-category'][@aria-label='Top Cities : Goa, India ']")).click(); 


q1) New to selenium so kindly provide the detail code if possible that helps to explain how to select city in drop down list
q2) Need to select any date similarly and click on select to proceed to next screen   ---> 
                      not require large code present in youtube . scenario is just to select one date from drop down for date field and proceed next 


Regards
Piyush


 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/d5d7dd76-f876-4e30-8de3-f9eb44e70eb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.