由于 org.openqa.selenium.NoSuchSessionException:两台不同计算机上的会话 ID


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)

登录和注销应用程序时会出现此问题。 我也验证了chrome版本/浏览器兼容性。 由于这个原因,一些 tome 测试运行良好,有时多个测试 ae 失败。

我尝试过的选项:

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".

执行以下代码时出现问题:

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.");
} 

我无法理解问题是什么。

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. 

我无法识别,如果正在运行测试的机器有问题,或者chrome驱动程序存在一些问题。

有人可以帮助我吗?

问题是两台计算机都使用相同的 chrome 会话

相关内容

  • 没有找到相关文章

最新更新