Selenium 启动 selenium 时运行报错

yunbin_7 · 2016年12月14日 · 最后由 anhehappy 回复于 2018年04月02日 · 2050 次阅读

启动 selenium 的测试代码后,提示,如下错误:
Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 11079
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 700 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'abingo', ip: '172.23.99.247', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_101'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116)
at com.yokeclub.test.GroupBuyTest.main(GroupBuyTest.java:20)
请大家帮忙看一下,这个是不是哪个配置的环境问题引起的?

共收到 2 条回复 时间 点赞

我的环境是:selenium2+python2.7,在调用 chromedriver 时,运行报错
不知道各位大神有没有遇到过,求解决方案

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册