【问题标题】:Running protractor tests on multiple browsers with browser stack使用浏览器堆栈在多个浏览器上运行量角器测试
【发布时间】:2015-03-26 02:37:26
【问题描述】:

我正在尝试在浏览器堆栈上的多个浏览器上运行 E2E 测试,我从 E2E testing on multiple/parallel browsers in Protractor?Internet Explorer Selenium protractor e2e tests

但是每次我尝试运行测试时都会遇到错误 -

错误 - 无法启动 WebDriver 会话。 C:\MrWhiteMVP\whitemvp-integrationtests_develop\node_modules\gulp-protractor\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:113 var template = new Error(this.message); ^ UnknownError:需要授权 在新的 bot.Error (C:\MrWhiteMVP\whitemvp-integrationtests_develop\node_modules\gulp-protractor\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:113:18) 在 Object.bot.response.checkResponse (C:\MrWhiteMVP\whitemvp-integrationtests_develop\node_modules\gulp-protractor\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:103:11)

但如果我在 1 个浏览器上运行测试,那么它工作得非常好。这就是我的 conf 文件的样子

    'use strict';
    exports.config = {
    seleniumAddress: 'http://hub.browserstack.com/wd/hub',

        multicapabilities: [{
            'browserstack.user': 'testuser',
            'browserstack.key': 'testkey',

            // Needed for testing localhost
                // 'browserstack.local': 'true',

            // Settings for the browser you want to test
            'browserName': 'chrome',
            'version': '36.0',
            'os': 'OS X',
            'os_version': 'Mavericks',
            'resolution': '1024x768'
        },
    {

    'browserstack.user': 'testuser',
    'browserstack.key': 'testkey',

    // Needed for testing localhost -  'browserstack.local': 'true',

    // Settings for the browser 

            'browserName': 'firefox',
    'os': 'windows'        
    }],  

    baseUrl: 'http://origin-develop.mvp.livebranches.com',

        // The require statement must be down here, since jasmine-reporters
            // needs jasmine to be in the global and protractor does not guarantee
            // this until inside the onPrepare function.

     onPrepare: function() 

    {
    require('jasmine-reporters');
    jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('xmloutput', true, true));

    },



        },
    };

谁能告诉我我在这里做错了什么,我们也使用 gulp ti run specs,但我的问题是它说甚至没有超出身份验证。

【问题讨论】:

  • 至少multicapabilities 应该是multiCapabilities (camelCase)。另外,如果你不使用 gulp 直接运行它会怎样:protractor conf.js?你用的是什么量角器版本?谢谢。
  • 我解决了,浏览器堆栈方面的一些问题,因此他们的支持有所帮助。此外,cameCase 是个好地方。它也有帮助。非常感谢!

标签: protractor browserstack


【解决方案1】:

我认为首先,您的配置中有一个额外的逗号。

 onPrepare: function() 

{
require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('xmloutput', true, true));

},



    }, <----- 
};

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-02
    • 2012-08-03
    相关资源
    最近更新 更多