gpt4 book ai didi

javascript - 实习生 JS + Saucelabs : Does not start session when using firefox browser

转载 作者:行者123 更新时间:2023-12-03 06:12:48 26 4
gpt4 key购买 nike

我最近开始使用 Intern js 和 Saucelabs 进行 ui 测试。想要在所有浏览器中进行测试,显然 Firefox 也不排除。

这是我的 gruntfile 配置:

        runner: {
options: {
config: 'tests/intern',
runType: 'runner',
sauceAccessKey: '<my key>',
sauceUsername: '<my username>',
environments: [
/* {
name: 'chrome',
browserName: 'chrome',
version: [ '52.0' ],
platform: [ 'Windows 7', 'OS X 10.10' ]
},*/
{
browserName: 'firefox',
platform: ['Windows 8', 'OS X 10.9'],
marionette: true
},
/*{
browserName: 'internet explorer',
version: [ '11.0' ],
platform: ['Windows 7']
}*/
]
}
}

这是 intern.js:

define({

capabilities: {
'selenium-version': '2.46.0'
},

maxConcurrency: 3,

tunnel: 'SauceLabsTunnel',
tunnelOptions: {
drivers: ['chrome', 'firefox']
},

useSauceConnect: false,

// Configuration options for the module loader; any AMD configuration options supported by the Dojo loader can be
// used here

// Non-functional test suite(s) to run in each browser
suites: [ ],

// Functional test suite(s) to run in each browser once non-functional tests are completed
functionalSuites: [ 'tests/first' ],

// A regular expression matching URLs to files that should not be included in code coverage analysis
excludeInstrumentation: /^/
});

用chrome和IE测试(实际上IE8也有一些问题!!)工作正常。当使用 grunt intern 运行时,实际发生的情况是:

Listening on 0.0.0.0:9000                                                                                                                                                                                 
Tunnel started
‣ Created session chrome 40 on Windows 7 (8773c63bf5a4469e8d92db57e6f51b63)
✓ chrome 40 on Windows 7 - index - toppage (2.969s)
No unit test coverage for chrome 40 on Windows 7
>> chrome 40 on Windows 7: 0/1 tests failed

‣ Created session chrome 46 on OS X 10.10 (b2ffbb9a639d4515a51b758ae382a1cf)
✓ chrome 46 on OS X 10.10 - index - toppage (3.514s)
No unit test coverage for chrome 46 on OS X 10.10
>> chrome 46 on OS X 10.10: 0/1 tests failed
>> TOTAL: tested 2 platforms, 0/2 tests failed
Goodbye.
Done.

但是当我尝试使用 Firefox(我也尝试使用旧版本)时,输出如下:

Listening on 0.0.0.0:9000                                                                                                                                                                                 
Tunnel started

看来实习生之类的东西无法与 Firefox 启动 session 。当我在 Saucelabs 仪表板中看到并尝试观看实时视频时,我在 Firefox 中看到什么都没有发生,除了地址栏中有 mozilla.org/... 且网页显示“无法建立安全连接” ”。一段时间后,浏览器将重新启动。这种情况发生了好几次。

隧道继续运行,没有任何反应。

请大家指导一下,是否有任何配置错误?或者配置不足?

提前致谢。

最佳答案

我认为问题可能与您的环境配置有关。我正在使用以下内容,测试在 Sauce Labs 上按预期进行。

environments: [
{ browserName: 'chrome', version: '51.0', platform: 'Windows 7' },
{ browserName: 'internet explorer', version: '11.0', platform: 'Windows 7' },
{ browserName: 'firefox', version: '45.0', platform: 'Windows 8.1' },
{ browserName: 'firefox', version: '46.0', platform: 'Windows 10' }
],

此外,我发现指定 2.50 之前的“selenium-version”也会导致错误。我建议转向以下内容:

capabilities: {
'selenium-version': '2.53.0',
},

关于javascript - 实习生 JS + Saucelabs : Does not start session when using firefox browser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39245658/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com