目前,我正在尝试通过设置无头 chrome 对 aa bitbucket 管道进行端到端量角器测试,目前我收到一些错误消息:
失败:此驱动程序实例没有有效的会话 ID(您是否调用了 WebDriver.quit()?)并且可能不再使用。这有什么线索吗?在本地运行测试如何正常工作;我可以设置一个恒定的会话ID吗?谢谢
目前,我正在尝试通过设置无头 chrome 对 aa bitbucket 管道进行端到端量角器测试,目前我收到一些错误消息:
失败:此驱动程序实例没有有效的会话 ID(您是否调用了 WebDriver.quit()?)并且可能不再使用。这有什么线索吗?在本地运行测试如何正常工作;我可以设置一个恒定的会话ID吗?谢谢
Check out your configuration file for this object
capabilities: {
"browserName": "chrome",
"chromeOptions": {
"args": ["incognito", "--window-size=1920,1080", "disable-extensions", "--no-sandbox", "start-maximized", "--test-type=browser"],
"prefs": {
"download": {
"prompt_for_download": false,
"directory_upgrade": true,
"default_directory": path.join(process.cwd(), "__test__reports/downloads")
}
}
}
},
When you find it, make sure you included "--no-sandbox" argument into args property.
What this guy does is it allows your tests to be ran from a remote container. In the meantime, if you include the argument when you run your tests on your machine, it has side effects like described here Chrome Instances don't close after running Test Case in Protractor