本文介紹了org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools error using ChromeDriver Chrome using Selenium and Java的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我看到以下錯誤并且瀏覽器之間斷開連接.它只發生在 chrome 上.我使用的 Selenium 版本是:
I am seeing below error and browser got disconnected between. Its happening only for chrome. Selenium version I am using is:
<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
推薦答案
這個錯誤信息...
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 無法啟動/生成新的瀏覽上下文,即 Chrome 瀏覽器 會話.
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
您的主要問題是您使用的二進制文件版本之間的不兼容性,如下所示:
Your main issue is the incompatibility between the version of the binaries you are using as follows:
- 您正在使用 chromedriver=78.0
- chromedriver=78.0的發行說明a> 明確提及以下內容:
支持 Chrome v78
- 您正在使用 chrome=79.0
- ChromeDriver v79.0的發行說明/a> 明確提及以下內容:
- You are using chrome=79.0
- Release Notes of ChromeDriver v79.0 clearly mentions the following :
- ChromeDriver 已更新為當前 ChromeDriver v79.0.3945.36 級別.
- Chrome 已更新至當前 Chrome 版本 79.0 級別.(根據 ChromeDriver v79.0 發行說明)
- 清理你的項目工作區通過你的IDE和重建你的項目只需要依賴.
- 如果您的基本 Web 客戶端 版本太舊,請卸載它并安裝最新的 GA 和發布版本的 Web 客戶端.
- 進行一次系統重啟.
- 以 非 root 用戶身份執行您的
@Test
. - 總是在
tearDown(){}
方法中調用driver.quit()
來關閉 &優雅地銷毀 WebDriver 和 Web Client 實例. - ChromeDriver is updated to current ChromeDriver v79.0.3945.36 level.
- Chrome is updated to current Chrome Version 79.0 level. (as per ChromeDriver v79.0 release notes)
- Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
- If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
- Take a System Reboot.
- Execute your
@Test
as non-root user. - Always invoke
driver.quit()
withintearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.
支持 Chrome 79
所以 ChromeDriver v78.0 和 Chrome 瀏覽器 v79.0
確保:
這篇關于org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools error using ChromeDriver Chrome using Selenium and Java的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!