我正在尝试使用Nightwatch框架来验证登录名来自动化一个简单的测试用例。我已按照https://www.softwaretestingmaterial.com/browser-automation-with-nightwatch-and-selenium/
上提到的步骤进行操作当我在node.js命令提示符下执行命令node nightwatch tests / bing_test.js时,就会出现问题,并导致错误消息。
下面是我的nightwatch.json配置:
{
"src_folders": ["tests"],
"output_folder": "reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "",
"globals_path": "",
"selenium": {
"start_process": true,
"server_path": "./lib/selenium-server-standalone-3.8.1.jar",
"log_path": "./reports",
"host": "127.0.0.1",
"port": 4445,
"cli_args": {
"webdriver.chrome.driver": "./lib/drivers/chromedriver.exe",
"webdriver.gecko.driver": "./lib/drivers/geckodriver.exe",
"webdriver.edge.driver": "./lib/drivers/MicrosoftWebDriver.exe"
}
},
"test_settings": {
"default": {
"launch_url": "http://localhost",
"selenium_port": 4445,
"selenium_host": "localhost",
"silent": true,
"screenshots": {
"enabled": true,
"path": "./reports/screenshots"
},
"desiredCapabilities": {
"browserName": "chrome",
"marionette": true,
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"chrome": {
"desiredCapabilities": {
"browserName": "chrome"
}
},
"firefox": {
"desiredCapabilities": {
"browserName": "firefox"
}
},
"edge": {
"desiredCapabilities": {
"browserName": "MicrosoftEdge"
}
}
}
}
错误消息:
[Bing Test] Test Suite
======================
Response 500 POST /wd/hub/session (363ms)
{ value:
{ error:
[ "Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'",
"System info: host: 'PDC2LAP-7173253', ip: '192.168.43.196', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201'",
'Driver info: driver.version: unknown' ],
message: 'Unable to create new service: ChromeDriverService' },
status: 33 }
An error occurred while retrieving a new session: "Unable to create new service: ChromeDriverService"
at endReadableNT (_stream_readable.js:1129:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
_________________________________________________
TEST FAILURE: 1 error during execution 0 tests failed, 0 passed. 2.886s
× bing_test
An error occurred while retrieving a new session: "Unable to create new service: ChromeDriverService"
at endReadableNT (_stream_readable.js:1129:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
SKIPPED:
- Bing search test
我试图通过设置“ webdriver.chrome.driver”:“”和“ start_process”:false来遍历GIT论坛上的注释来调试问题,但两者均无效。
ChromeDriver版本-v72 硒独立罐-3.8.1
请随时指导我解决此问题的任何现有答案/文档。