我正在尝试在Mac上使用Webdriver.io、Selenium和ChromeDriver运行自动化测试。我使用了所有相关软件的最新版本:
- Selenium 3.9.1 - ChromeDriver 2.35 - Chrome 64 - 操作系统: macOS High Sierra 10.13.3
当我尝试从CLI运行wdio时,我会得到以下输出:
这个过程随后停止。Chrome图标在Dock上短暂出现,然后立即消失。
我尝试从CLI启动Selenium独立服务器,导航到http://localhost:4444/wd/hub/static/resource/hub.html并尝试在那里手动启动Chrome会话,但结果相同:Chrome图标弹出,然后消失,Selenium抛出错误“无法创建新会话”。
我还尝试下载旧版Chromium并强制ChromeDriver使用它,但无法启动可执行文件。
- Selenium 3.9.1 - ChromeDriver 2.35 - Chrome 64 - 操作系统: macOS High Sierra 10.13.3
当我尝试从CLI运行wdio时,我会得到以下输出:
$ ./node_modules/.bin/wdio --spec ./test_js/specs/features/aggregated/dataAccessControl.feature.js
----------
selenium-standalone installation starting
----------
---
selenium install:
from: https://selenium-release.storage.googleapis.com/3.9/selenium-server-standalone-3.9.1.jar
to: /PROJECT_PATH/node_modules/selenium-standalone/.selenium/selenium-server/3.9.1-server.jar
---
chrome install:
from: https://chromedriver.storage.googleapis.com/2.35/chromedriver_mac64.zip
to: /PROJECT_PATH/node_modules/selenium-standalone/.selenium/chromedriver/2.35-x64-chromedriver
---
File from https://selenium-release.storage.googleapis.com/3.9/selenium-server-standalone-3.9.1.jar has already been downloaded
---
File from https://chromedriver.storage.googleapis.com/2.35/chromedriver_mac64.zip has already been downloaded
-----
selenium-standalone installation finished
-----
A service failed in the 'onPrepare' hook
Error: Unable to connect to selenium
at Timeout.hasStarted [as _onTimeout] (/PROJECT_PATH/node_modules/selenium-standalone/lib/check-started.js:17:10)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
Continue...
ERROR: session not created exception
from disconnected: unable to connect to renderer
chrome
at new RuntimeError (/PROJECT_PATH/node_modules/webdriverio/build/lib/utils/ErrorHandler.js:144:12)
at Request._callback (/PROJECT_PATH/node_modules/webdriverio/build/lib/utils/RequestHandler.js:313:39)
at Request.self.callback (/PROJECT_PATH/node_modules/request/request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (/PROJECT_PATH/node_modules/request/request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (/PROJECT_PATH/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
这个过程随后停止。Chrome图标在Dock上短暂出现,然后立即消失。
我尝试从CLI启动Selenium独立服务器,导航到http://localhost:4444/wd/hub/static/resource/hub.html并尝试在那里手动启动Chrome会话,但结果相同:Chrome图标弹出,然后消失,Selenium抛出错误“无法创建新会话”。
我还尝试下载旧版Chromium并强制ChromeDriver使用它,但无法启动可执行文件。