【问题标题】:Protractor tests with Muliple browsers got failed at startup使用多个浏览器的量角器测试在启动时失败
【发布时间】: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


【解决方案1】:

尝试使用directConnect: true 而不是使用seleniumAddress: http://localhost:4444/wd/hub

或确保您的网格服务器已启动并运行,并且 selenium 服务器已启动并运行

启动 selenium 服务器的命令webdriver-manager start

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-03-26
    • 2020-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多