I am not able to click on the specific date in the Makemytrip website, it is continously throwing exception

38 Views Asked by At

Sharing my error here:

Exception in thread "main" org.openqa.selenium.TimeoutException: Expected condition failed: waiting for presence of element located by: By.xpath: //div[@class='flt_fsw_inputBox dates inactiveWidget ']//span[contains(text(), 'Departure')] (tried for 20 second(s) with 500 milliseconds interval)
        at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:84)
        at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:230)
        at demo.TestCases.clickOnDeparture(TestCases.java:123)
        at demo.TestCases.testCase02(TestCases.java:98)
        at demo.App.getGreeting(App.java:17)
        at demo.App.main(App.java:26)
Caused by: org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@class='flt_fsw_inputBox dates inactiveWidget ']//span[contains(text(), 'Departure')]"}
  (Session info: chrome=121.0.6167.85)
For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Build info: version: '4.14.0', revision: 'e5a96349ce'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.0', java.version: '17.0.9'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [a7605f56c923ab8911d2a39e2a4aeedc, findElement {using=xpath, value=//div[@class='flt_fsw_inputBox dates inactiveWidget ']//span[contains(text(), 'Departure')]}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 121.0.6167.85, chrome: {chromedriverVersion: 120.0.6099.109 (3419140ab66..., userDataDir: /var/folders/vs/y2kphm_x7bj...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:50083}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: mac, proxy: Proxy(), se:cdp: ws://localhost:50083/devtoo..., se:cdpVersion: 121.0.6167.85, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Session ID: a7605f56c923ab8911d2a39e2a4aeedc
        at jdk.internal.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
        at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
        at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:52)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:191)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:196)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:171)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:602)
        at org.openqa.selenium.remote.ElementLocation$ElementFinder$2.findElement(ElementLocation.java:165)
        at org.openqa.selenium.remote.ElementLocation.findElement(ElementLocation.java:59)
        at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:359)
        at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:353)
        at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:171)
        at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:168)
        at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:205)
        ... 4 more

> Task :run FAILED

FAILURE: Build failed with an exception.

I was trying to click on a specific date from the departure date field.

0

There are 0 best solutions below