无法在量角器中启动多个浏览器实例 [英] Unable to launch multiple browser instances in Protractor

查看:130
本文介绍了无法在量角器中启动多个浏览器实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的配置文件正在启动1个chrome实例.我希望它能打开2. 这是我的配置多功能.

My config file is just launching 1 instance of chrome. I'm expecting it to open 2. This is my config multi capabilities.

multiCapabilities: [
{
browserName: 'chrome',
logName: 'Chrome - Suite 1',
shardTestFiles: false,
maxInstances: 1,
maxSessions: 1,
specs: ['test/protractor/test.js']
},
{
browserName: 'Chrome',
logName: 'Chrome - Suite 2',
shardTestFiles: false,
maxInstances: 1,
maxSessions: 1,
specs: ['test/protractor/test2.js']
}
],

现在我正面临如下错误:

Now I am facing the error as below:

    /usr/local/lib/node_modules/protractor/node_modules/selenium- 
webdriver/lib/error.js:546
      throw new ctor(message);
            ^
SessionNotCreatedError: Unable to create session from {
"desiredCapabilities": {
  "specs": [
    "test\u002fprotractor\u002ftest2.js"
  ],
  "maxSessions": 1,
  "logName": "Chrome - Suite 2",
  "count": 1,
  "browserName": "Chrome",
  "maxInstances": 1,
  "shardTestFiles": false
},
"capabilities": {
  "firstMatch": [
    {
      "browserName": "Chrome"
    }
  ]
}
}
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018- 
11 
14T08:25:53'
System info: host: 'Siva.local', ip: 
'fe80:0:0:0:4b7:1bb3:a4c7:925f%en0', os.name: 'Mac OS X', os.arch: 
'x86_64', os.version: '10.14', java.version: '1.8.0_131'
Driver info: driver.version: unknown

非常欢迎任何帮助它启动2个实例的事情.

Any help to make it launch 2 instances is highly welcome.

推荐答案

使您的config如下所示.

exports.config = {

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    browserName: 'chrome',

    // allows different specs to run in parallel.
    // If this is set to be true, specs will be sharded by file
    // (i.e. all files to be run by this set of capabilities will run in parallel).
    // Default is false.
    shardTestFiles: true,

    // Maximum number of browser instances that can run in parallel for this
    // set of capabilities. This is only needed if shardTestFiles is true.
    // Default is 1.
    maxInstances: 2,       
  },

  // Spec patterns are relative to the current working directly when
  // protractor is called.
  specs: ['spec.js', 'spec2.js'],
}

希望它对您有帮助.

这篇关于无法在量角器中启动多个浏览器实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆