我使用Nightwatch版本1.0.18运行nightwatch.js测试,它在Windows环境下工作正常,但是当我在CentOS上运行时,在安装了Xvfb后出现以下错误。
Error while running .navigateTo() protocol action: invalid session id
Error while running .locateMultipleElements() protocol action: invalid session id
Error while running .locateMultipleElements() protocol action: invalid session id
以下是我的nightwatch.json文件代码:
{
"src_folders": [
"./tests"
],
"output_folder": "./reports",
"custom_commands_path": "./custom_commands",
"custom_assertions_path": "",
"test_workers": false,
"webdriver": {
"start_process": true
},
"test_settings": {
"default": {
"webdriver": {
"port": 9515,
"server_path": "./node_modules/chromedriver/lib/chromedriver/chromedriver",
"cli_args": [
"--log",
"debug"
]
},
"skip_testcases_on_fail": true,
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"chromeOptions": {
"args": [
"headless",
"no-sandbox",
"disable-gpu"
]
}
}
}
}
}
我在CentOS环境下运行测试时是否遗漏了某些内容,因为它是在Windows环境下运行的?
Error while running .navigateTo() protocol action: invalid session id
。 - axelchromedriver
作为独立运行而非节点模块时更加顺利,如果您想让我逐步发布步骤,请告诉我。 - Alex Andrei