我有我目前的测试套件的e2e测试在量角器。
为了将其更新为在无头铬中运行,我更新了量角器版本,后者又更新了我的webdriver,后者又将chromedriver版本更新为最新版本,即2.34。
它不允许做任何其他事情,因为chrome自动浏览器实例经常出现。
我试着把色度驱动程序的版本降到2.29,但没什么好运气。
有人面临过这个问题吗?
我在测试套件中的当前版本如下:
发布于 2018-01-02 22:36:55
对我来说,无头测试与量角器的工作原理完全一样。没有窗口弹出,我有完全相同的版本。
确保在量角器的配置文件中有以下参数。
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--headless', '--disable-gpu']
}
},
在您的配置文件中,可以尝试具体地调用chromedriver。
exports.config = {
seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.8.1.jar',
chromeDriver: '../node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.34',
directConnect: false, //you can try true.
发布于 2018-01-16 08:39:06
您的问题可能是由于操作系统的不同造成的;当运行像Mac这样基于*NIX的系统时,应该将“--无沙箱”添加到chromeOptions中。在使用windows时,添加“-禁用-gpu”。两者兼用不会有什么坏处。因此,您在protactor的配置文件中的功能如下所示:
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--headless', '--disable-gpu', '--no-sandbox']
}
},
我希望这能帮到你。
https://stackoverflow.com/questions/48072227
复制