org.openqa.selenium.WebDriverException:已断开连接:使用ChromeDriver Chrome和使用Selenium和Java的Chrome未连接到DevTools错误

问题描述 投票:0回答:1

我看到以下错误,浏览器之间断开连接。它仅在铬中发生。我正在使用的硒版本是:

<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version> 

错误堆栈跟踪:

[1579632222.785][SEVERE]: Unable to receive message from renderer
org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools
  (Session info: chrome=79.0.3945.117)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'MBP15-PBJGH8.8x8.com', ip: 'fe80:0:0:0:1846:114d:10a6:bf26%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_201'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 79.0.3945.117, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: /var/folders/mz/2_llwtkx31d...}, goog:chromeOptions: {debuggerAddress: localhost:54446}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 3577826ba5ac2d089a34e17f9aa987c9
java selenium google-chrome selenium-chromedriver cucumber-jvm
1个回答
0
投票

此错误消息...

org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools
  (Session info: chrome=79.0.3945.117)
.
.
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 79.0.3945.117, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: /var/folders/mz/2_llwtkx31d...}, goog:chromeOptions: {debuggerAddress: localhost:54446}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}

...表示ChromeDriver无法启动/产生新的Browsing Context,即Chrome Browser会话。

您的主要问题是正在使用的二进制版本之间的incompatibility,如下所示:

  • 您正在使用chromedriver = 78.0
  • chromedriver=78.0的发行说明明确提到以下内容:

支持Chrome v78

支持Chrome 79

因此ChromeDriver v78.0Chrome浏览器v79.0之间明显不匹配”>


解决方案

确保:

  • ChromeDriver已更新为当前ChromeDriver v79.0.3945.36级别。
  • Chrome
  • 已更新为当前的Chrome 79.0级。 (根据ChromeDriver v79.0 release notes
  • Clean
  • 您的Project Workspace通过您的IDERebuild您的项目仅具有必需的依赖项。
  • 如果您的基本Web Client
  • 版本太旧,则将其卸载并安装最新的GA和Web Client的发行版本。
  • 进行系统重启
  • 非root
  • 用户身份执行@Test。>>
  • 总是在driver.quit()方法中调用tearDown(){}以正常关闭并销毁WebDriver和Web Client
  • 实例。
© www.soinside.com 2019 - 2024. All rights reserved.