Java org.openqa.selenium.NoSuchSessionException:无效会话id消息=此版本的ChromeDriver仅支持Chrome版本74
我正在尝试连接到ChromeVersion76和chromedriver 76 我已经尝试了chromedriver的所有版本,但似乎没有人在工作Java org.openqa.selenium.NoSuchSessionException:无效会话id消息=此版本的ChromeDriver仅支持Chrome版本74,java,selenium,google-chrome,selenium-webdriver,selenium-chromedriver,Java,Selenium,Google Chrome,Selenium Webdriver,Selenium Chromedriver,我正在尝试连接到ChromeVersion76和chromedriver 76 我已经尝试了chromedriver的所有版本,但似乎没有人在工作 org.openqa.selenium.NoSuchSessionException: invalid session id (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),pl
org.openqa.selenium.NoSuchSessionException: invalid session id
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 12 milliseconds
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'KASTIOT', ip: '192.168.0.104', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=session not created: This version of ChromeDriver only supports Chrome version 74
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 10.0.17134 x86_64), platform=ANY}]
Session ID: 85ef5c2570c97d5b10f13f818d4096f4
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.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:325)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:915)
at stepdefs.websitesteps.ZitiCard.goToWebsite(ZitiCard.java:30)
at ✽.Given Go to website(C:/Users/lotib/Desktop/recyclego 2/src/test/java/website/ZitiCard.feature:5)
为了确保它转到我写下的链接并遵循场景
帮助会很好:)当您尝试在webdriver.quit()之后执行任何操作时,都不会发生这种SessionExpect。 确保在webdriver.quit()之后没有调用任何命令。此错误消息
org.openqa.selenium.NoSuchSessionException: invalid session id
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 12 milliseconds
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'KASTIOT', ip: '192.168.0.104', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
…意味着ChromeDriver无法启动/生成新的网络浏览器,即Chrome浏览器会话
您的主要问题是所使用的二进制文件版本之间的不兼容,如下所示:
- 您使用的是chromedriver=74.0
- 的发行说明明确提到以下内容:
- 假设您使用的是chrome=75.0或chrome=76.0
- 的发行说明明确提到以下内容:
- 您的Selenium客户端版本为2017-03-10 09:10:29+0000的3.3.1版,几乎比2017-03-10 09:10:29+0000版早了2年
- 您的JDK版本是1.8.0_111,它非常古老
解决方案 确保:
- JDK已升级到当前级别
- 硒被提升到当前水平
- ChromeDriver已更新到当前级别
- Chrome更新到当前的Chrome 76.0版本。(根据)
- 通过IDE清理项目工作区,并仅使用所需的依赖项重建项目
- 重新启动系统
- 以非root用户身份执行
@Test
- 我也有类似的问题。只需将
--禁用dev-shm用法传递给chrome就可以做到这一点
铬崩溃
Chrome使用/dev/shm作为运行时数据,Docker下默认为64MB。如果这是>不够的,那么这可能会导致Chrome崩溃。可能的解决办法:
- 增加/dev/shm的大小
- 将/dev/shm装载到主机的
- 使用标志启动Chrome--禁用开发人员shm使用
资料来源:lotiblakaj123@gmail.com如果你想要更多的解释,请看我的电子邮件!你在默认目录中安装了Chrome吗?谢谢,我已经修复了它,驱动程序版本有问题,我还添加了这个,让驱动程序在完成后退出,因为它只是阻止了por。