Die book now
Schaltfläche auf Irctc ist nicht anklickbar. Der angezeigte Fehler ist nicht interaktiv. Ich versuchte mitKlicken Sie auf Schaltfläche, die auf IRCTC nicht sichtbar ist, mit Selenium
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("")));
Aber immer noch kein Gewinn.
FirefoxOptions options = new FirefoxOptions();
options.setBinary("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); //This is the location where you have installed Firefox on your machine
WebDriver driver = new FirefoxDriver(options);
WebDriverWait wait = new WebDriverWait(driver, 10);
driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);
driver.get("http://www.irctc.co.in");//It will open the website
driver.manage().window().maximize();//It will maximize the window
Thread.sleep(5000);//For Entering the Captcha before 5sec
driver.findElement(By.xpath("//input[@id='usernameId']")).sendKeys("");//enter username
driver.findElement(By.xpath("//input[@class='loginPassword']")).sendKeys("");//enter password
driver.findElement(By.xpath("//input[@id='loginbutton']")).click();//clicks on sign in
Thread.sleep(2000);
driver.findElement(By.xpath("//input[@id='jpform:fromStation']")).sendKeys("H NIZAMUDDIN - NZM");//origin station
driver.findElement(By.xpath("//input[@id='jpform:toStation']")).sendKeys("KOTA JN - KOTA");//destination station
driver.findElement(By.xpath("//input[@id='jpform:journeyDateInputDate']")).sendKeys("18-05-2017");//Date Of Journey
Thread.sleep(2000);
driver.findElement(By.xpath("//input[@id='jpform:jpsubmit']")).click();//Clicks to find the trains
Thread.sleep(2000);
driver.findElement(By.xpath("//a[@id='cllink-13237-CC-1']")).click();//Clicks the class of train to find available seats
Thread.sleep(5000);
driver.findElement(By.xpath("//a[@id='13237-3A-GN-0']")).click();//For clicking on Book Now, but is not functioning.
Kein Element mit ID 'cllink-13237-CC-1' existiert auf der Seite. Welchen Zug wolltest du auswählen? –
Die Zugnummer, die ich im Code erwähnt habe, ist falsch. Ansonsten wurde diese Codezeile im Firefox Browser erfolgreich ausgeführt. –