在量角器"镀铬无法到达"错误来了

时间:2017-09-14 16:19:54

标签: java google-chrome selenium protractor

我的机器是Windows 7,chrome是最新的32位,下面是conf.js

 exports.config = {
    // directConnect:true,
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['todo-spec.js'],

  capabilities:  {
    'browserName': 'chrome',
    'chromeOptions': {
      'binary': 'D:/chromedriver.exe',
  }   },
};

当我在conf.js以上运行时出现错误

    [21:37:58] I/launcher - Running 1 instances of WebDriver
[21:37:58] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[21:39:02] E/launcher - chrome not reachable


[21:39:02] E/launcher - WebDriverError: chrome not reachable
  (Driver info: chromedriver=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c581090
6a),platform=Windows NT 6.1.7601 SP1 x86) (WARNING: The server did not provide a
ny stacktrace information)

[21:39:02] E/launcher - Process exited with error code 199

下面是selenium服务器启动日志,它的32位机器带有量角器的基本代码

    webdriver-manager: using global installed version 12.0.6
[22:39:26] I/start - java -Dwebdriver.chrome.driver=C:\Users\Yogi\AppData\Roamin
g\npm\node_modules\webdriver-manager\selenium\chromedriver_2.32.exe -Dwebdriver.
gecko.driver=C:\Users\Yogi\AppData\Roaming\npm\node_modules\webdriver-manager\se
lenium\geckodriver-v0.18.0.exe -jar C:\Users\Yogi\AppData\Roaming\npm\node_modul
es\webdriver-manager\selenium\selenium-server-standalone-3.5.3.jar -port 4444
[22:39:26] I/start - seleniumProcess.pid: 6016
22:39:38.385 INFO - Selenium build info: version: '3.5.3', revision: 'a88d25fe6b
'
22:39:38.401 INFO - Launching a standalone Selenium Server
2017-09-14 22:39:39.174:INFO::main: Logging initialized @11199ms to org.selenium
hq.jetty9.util.log.StdErrLog
22:39:40.463 INFO - Driver class not found: com.opera.core.systems.OperaDriver
22:39:41.354 INFO - Driver provider class org.openqa.selenium.safari.SafariDrive
r registration is skipped:
 registration capabilities Capabilities [{browserName=safari, version=, platform
=MAC}] does not match the current platform VISTA
22:39:42.073 INFO - Using the passthrough mode handler
2017-09-14 22:39:42.862:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2017-09-14 22:39:43.354:WARN:osjs.SecurityHandler:main: ServletContext@o.s.j.s.S
ervletContextHandler@1784306{/,null,STARTING} has uncovered http methods for pat
h: /
2017-09-14 22:39:43.448:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletC
ontextHandler@1784306{/,null,AVAILABLE}
2017-09-14 22:39:49.823:INFO:osjs.AbstractConnector:main: Started ServerConnecto
r@95a785{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2017-09-14 22:39:49.823:INFO:osjs.Server:main: Started @21844ms
22:39:49.823 INFO - Selenium Server is up and running

1 个答案:

答案 0 :(得分:0)

 'chromeOptions': {
      'binary': 'D:/chromedriver.exe',
  } 

二进制文件应该指定chrome.exe位置而不是chrome的webdriver。如果您的Chrome浏览器安装在默认位置,请删除chromeOptions,否则请在此处指定正确的路径。