org.openqa.selenium.NoSuchSessionException: invalid session id
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:25:02.294Z'
System info: host: 'chaos', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.21.3.el7.x86_64', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 83.0.4103.106, chrome: {chromedriverVersion: 83.0.4103.39 (ccbf011cb2d2b..., userDataDir: /tmp/.com.google.Chrome.XiR2sj}, goog:chromeOptions: {debuggerAddress: localhost:37450}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: cf2b9146e49c20dccbba70b575b2a393
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:160)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:325)
at com.tomtom.workflow.iris.uitest.pages.LoginService.logout(LoginService.java:66)
This problem is coming while logging/logged into the application. I have verified the chrome version/browser compatibility as well. Some tome tests are running well and some time multiple tests ae getting failed due to this reason.
Options I have tried:
checked Chrome driver compatibility:
browserVersion: 83.0.4103.106,chromedriverVersion: 83.0.4103.39
I have also checked the test;there is no use of driver.quit() and
driver.close()
Selenium server version is "3.141.59".
JDK version is "1.8".
Problem is coming in executing the below code:
public void logout(String url) throws URISyntaxException {
// when user is logged out
URIBuilder uri = new URIBuilder(url);
uri.setPath("uiris/logout");
**$.driver().get().get(uri.toString());** //this line is causing the
issue.
$("*[id='login.signIn']").waitUntil(5000).isPresent();
LOG.info("log out is done successfully.");
}
I am not able to understand what is the issue.
The issue is not reproduced, if the tests are run on the local machine. But
when tests are running on two different Jenkins created machines in
parallel, then multiple tests are getting failed due to this problem only on
one machine.
Anybody can help me with this?