【发布时间】:2020-07-21 23:19:32
【问题描述】:
我正在尝试为 chrome 和 firefox 运行 e2e 测试,但我无法使用以下配置加载 chrome 浏览器,非常感谢任何评论,谢谢
var HtmlReporter = require('protractor-beautiful-reporter');
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [ **some spec**
],
multiCapabilities: [{
"browserName": "firefox"
},
{
"browserName": "chrome",
}
],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 180000
},
allScriptsTimeout: 200000,
onPrepare: function () {
browser.manage().timeouts().implicitlyWait(20000);
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: 'test-result',
preserveDirectory: false,
takeScreenShotsOnlyForFailedSpecs: true,
screenshotsSubfolder: 'images'
}).getJasmine2Reporter());
}
};
【问题讨论】:
-
您遇到了什么错误?你的节点注册到集线器了吗?
-
@AmitJain 感谢您的提醒,是的,它被配置为管道,我如何尝试在本地运行,这是我收到的错误
WebDriverError: invalid argument: can't kill an exited process -
尝试
directConnect: true而不是使用seleniumAddress: http://localhost:4444/wd/hub或确保您的服务器正在运行,这是webdriver-manager start的命令 -
我还建议这可能是一个权限问题,所以一旦您确保您的集线器已启动并在您提供的 url 上运行 尝试运行您的配置文件来自 cmd 的管理员权限 这是选择 chromedriver 执行测试的地方 C:\Users\UserName\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium
-
@AmitJain 非常感谢!!使用直接连接 true 解决的问题
标签: automation protractor