org.openqa.selenium.WebDriverException:chrome无法访问 - 尝试启动新会话时 [英] org.openqa.selenium.WebDriverException: chrome not reachable - when attempting to start a new session
问题描述
当我在Chrome上运行测试时,我经常会遇到无法访问Chrome的WebdriverException。它不会每次都发生。也许每15次一次。我不得不在Windows机器上运行所有东西,我有最新的Chrome,Chromedriver,Selenium-Webdriver版本。
When I run my tests on Chrome I often get a WebdriverException that Chrome is not reachable. It doesn't happen every time. Maybe once every 15 times. I am having to run everything on Windows machines and I have the latest Chrome, Chromedriver, Selenium-Webdriver versions.
我尝试过设置环境变量DBUS_SESSION_BUS_ADDRESS = / dev / null。根本没有帮助。
I've tried setting the environmental variable "DBUS_SESSION_BUS_ADDRESS=/dev/null". Doesn't help at all.
有人遇到这个并找到了解决方案吗?
Anyone come across this and found a solution?
org.openqa.selenium.WebDriverException: chrome not reachable
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 62.52 seconds
Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'CORPMNA7158A', ip: '10.26.195.163', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.chrome.ChromeDriver
推荐答案
错误确实给了我们一些提示,如下所示:
The error does gives us some hint as follows :
org.openqa.selenium.WebDriverException: chrome not reachable
哪个ess实际意味着 chromedriver
二进制文件无法生成新的 Chrome浏览器
进程。
Which essentially implies that chromedriver
binary is unable to spawn a new Chrome Browser
process.
您的主要问题是您使用的二进制文件中的版本兼容性,如下所示:
Your main issue is the version compatibility among the binaries you are using as follows :
- 您正在使用
chromedriver = 2.35.528161
(已发布2018-01-10
) - <$ c的发行说明$ c> chromedriver = 2.35 明确提到以下内容:
- You are using
chromedriver=2.35.528161
(released2018-01-10
) - Release Notes of
chromedriver=2.35
clearly mentions the following :
支持Chrome v62-64
Supports Chrome v62-64
- 您提到过使用最新的Chrome。我认为它是
chrome = 65.x
- 您正在使用
Selenium版本2.52.0
(已发布 2016-02-11 11:22:43 )[根据错误堆栈在您的问题中跟踪
] - You mentioned of using latest Chrome. I suppose it is
chrome=65.x
- You are using
Selenium Version 2.52.0
(released 2016-02-11 11:22:43) [as per the error stack trace within your question
] - 保持
ChromeDriver
v2.35
级别。 - 降级
Chrome
稳定Chrome v64.x
级别。 (根据ChromeDriver v2.35发行说明 - 将
Selenium
升级到当前级别版本3.8.1
。 - 执行
测试
。 - Keep the
ChromeDriver
atv2.35
level. - Downgrade
Chrome
to stableChrome v64.x
levels. (as per ChromeDriver v2.35 release notes
) - Upgrade
Selenium
to current levelsVersion 3.8.1
. - Execute your
Test
.
因此 <$ c $发布之间的时间差距c> Selenium版本2.52.0 和 chromedriver = 2.35.528161
几乎 2年且不兼容。因此, ChromeDriver
有时无法生成新的 Chrome浏览器
流程。
So the time gap between the release of Selenium Version 2.52.0
and chromedriver=2.35.528161
is almost 2 Years and are not compatible. Hence ChromeDriver
is unable to spawn the new Chrome Browser
process at times.
这篇关于org.openqa.selenium.WebDriverException:chrome无法访问 - 尝试启动新会话时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!