【发布时间】:2017-04-26 15:41:31
【问题描述】:
只是无法让它在我的 Mac 上运行。
它在我的 Windows 机器上运行良好,没有任何配置更改等等,但我将它安装在我的 Mac 上,并且想不出如何让它工作
节点版本:3.10.7
量角器版本:版本 4.0.13
浏览器:Chrome
操作系统和版本 OS X El Capitan
已安装的驱动程序:
/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium
还有 chromedriver_2.25
另外:
- 从https://chromedriver.storage.googleapis.com/index.html?path=2.26/下载
-
复制到:/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium 还是行不通 有什么办法可以在 conf 文件中设置这个吗?
日志:
$ 量角器 conf_basic.js [18:34:22] I/hosted - 在http://localhost:4444/wd/hub 使用 selenium 服务器 [18:34:22] I/launcher - 运行 1 个 WebDriver 实例 [18:34:23] E/launcher - 驱动程序可执行文件的路径必须由 webdriver.chrome.driver 系统属性设置;有关详细信息,请参阅https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver。最新版本可以从http://chromedriver.storage.googleapis.com/index.html下载 [18:34:23] E/launcher - WebDriverError:驱动程序可执行文件的路径必须由 webdriver.chrome.driver 系统属性设置;有关详细信息,请参阅https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver。最新版本可以从http://chromedriver.storage.googleapis.com/index.html下载 在 WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5) 在 Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15) 在 parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:538:13) 在 client_.send.then.response (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11) 在 ManagedPromise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14) 在 TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14) 在 TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
编辑
webdriver-manager update --versions.chrome 2.26
[07:32:45] I/update - selenium 独立:文件存在 /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar [07:32:45] I/update - selenium 独立:v2.53.1 是最新的 [07:32:45] I/更新-chromedriver:文件存在/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26mac64.zip [07:32:45] I/更新 - chromedriver:解压缩 chromedriver_2.26mac64.zip [07:32:45] I/update - chromedriver:将 /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26 的权限设置为 0755 [07:32:45] I/更新 - chromedriver: v2.26 是最新的 [07:32:47] I/更新-geckodriver:文件存在/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.11.1-macos.tar.gz [07:32:47] I/更新 - geckodriver:解压缩 geckodriver-v0.11.1-macos.tar.gz [07:32:47] I/update - geckodriver:将 /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.11.1 的权限设置为 0755 [07:32:47] I/update - geckodriver: vv0.11.1 最新
为了给它更多权限,我去了:/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium
并执行 chmod 777 chromedriver_2.26
然后我启动它:webdriver-manager start --versions.chrome 2.26 正如你告诉我的那样。还是不开心
[07:38:11] I/start - java -Dwebdriver.chrome.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.26 -Dwebdriver.gecko.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.11.1 -jar /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar -port 4444
[07:38:11] I/start - seleniumProcess.pid: 509
07:38:12.779 INFO - Launching a standalone Selenium Server
07:38:12.887 INFO - Java: Oracle Corporation 25.101-b13
07:38:12.887 INFO - OS: Mac OS X 10.11.6 x86_64
07:38:12.965 INFO - v2.53.1, with Core v2.53.1. Built from revision a36b8b1
07:38:13.106 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform MAC
07:38:13.107 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform MAC
07:38:13.107 INFO - Driver class not found: com.opera.core.systems.OperaDriver
07:38:13.107 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
07:38:13.110 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUnitDriver
07:38:13.110 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
07:38:13.368 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
07:38:13.368 INFO - Selenium Server is up and running
解决方案
- sudo 量角器 cons.js 或
- 下载chromedriver并复制到usr/local/bin
【问题讨论】:
标签: macos protractor selenium-chromedriver