【发布时间】:2018-06-19 09:46:14
【问题描述】:
这是我的 Selenium 设置:
"selenium": {
"start_process": true,
"start_session": true,
"server_path": "./nightwatch/drivers/selenium-server.jar",
"log_path": "./nightwatch/reports",
"host": "127.0.0.1",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": "nightwatch/drivers/chromedriver.exe",
"webdriver.gecko.driver": "nightwatch/drivers/geckodriver.exe",
"webdriver.ie.driver": "nightwatch/drivers/IEDriverServer.exe"
}
}
我的 Firefox 设置:
"firefox": {
"selenium_port": 4444,
"default_path_prefix": "/wd/hub",
"globals": {
"environment": "firefox"
},
"desiredCapabilities": {
"browserName": "firefox",
"alwaysMatch": {
"moz:firefoxOptions": {
"args": ["-headless"]
}
}
}
}
Firefox 已成功打开并进行测试,但不是无头模式。
我正在使用的版本:
- Firefox 60(64 位)
- 硒 3.4
- Geckodriver 0.20(64 位)
【问题讨论】:
-
你可以试试
"args" : ["headless", "no-sandbox", "disable-gpu"]
标签: node.js selenium nodes nightwatch.js geckodriver