1

我在使用“multiCapabilities”运行测试时遇到问题。我的 multiCapabilities 配置是:

   multiCapabilities: [{
    browserName: 'chrome',
    'name': 'LMB Decision Engine - UI Automation',
    'tunnel-identifier': 'nonprod',
    'parent-tunnel': 'LMSauceLabs'
  }, {
    browserName: 'chrome',
    'name': 'LMB Decision Engine - UI Automation',
    'tunnel-identifier': 'nonprod',
    'parent-tunnel': 'LMSauceLabs'
  }],

我得到的回应是:

[chrome #2]     Failed: stale element reference: element is not attached to the page document
[chrome #2]       (Session info: chrome=47.0.2526.73)
[chrome #2]       (Driver info: chromedriver=2.20.353141 (da3cb4b52d3a04ce079546eac4dc96182f58602b),platform=Linux 3.13.0-32-generic x86)

但是,当我使用此功能配置运行时,它会通过:

  capabilities : {
    'browserName': 'firefox',
    'name': 'LMB Decision Engine - UI Automation',
    'tunnel-identifier': 'nonprod',
    'parent-tunnel': 'LMSauceLabs'
  },

有没有人在并行运行时看到这个问题?我尝试了所有不同的浏览器组合,并单独禁用所有插件以查看它们是否与 multiCapabilities 不兼容,但问题似乎只是单独在并行版本中运行。

谢谢,泰勒

4

1 回答 1

3

如果您尝试在 chrome 中运行并行测试,您可以在多功能配置中使用 shardTestFiles:true ,如下所示:

multiCapabilities: [
    {
    browserName: 'chrome',
    shardTestFiles: true, 
     // change this to the number of instances you want to run
    maxInstances:2
}];
于 2016-01-15T13:01:20.723 回答