我正在使用wdioV5和browserstack运行测试,但是出现以下错误:
ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read property 'capabilities' of null
我试图检查调试日志,但无法弄清其背后的原因,有人遇到过类似的问题吗?
调试输出:
[0-0] 2019-06-06T13:34:00.454Z INFO webdriver: Retrying 3/3
[0-0] 2019-06-06T13:34:00.455Z INFO webdriver: [POST] https://hub-cloud.browserstack.com:443/session
[0-0] 2019-06-06T13:34:00.455Z INFO webdriver: DATA { capabilities:
{ alwaysMatch:
{ os: 'Windows',
os_version: '10',
browser: 'Chrome',
browser_version: '73.0',
'browserstack.local': true },
firstMatch: [ {} ] },
desiredCapabilities:
{ os: 'Windows',
os_version: '10',
browser: 'Chrome',
browser_version: '73.0',
'browserstack.local': true } }
[0-0] 2019-06-06T13:34:00.480Z DEBUG webdriver: request failed due to status 13
[0-0] 2019-06-06T13:34:00.481Z ERROR webdriver: Request failed due to Error: Session not started or terminated
如果有帮助,我的配置是:
path: '/',
specs: [ './specs/**/*.js' ],
exclude: [],
maxInstances: 10,
capabilities:
[ { os: 'Windows',
os_version: '10',
browser: 'Chrome',
browser_version: '73.0' } ],
logLevel: 'trace',
bail: 0,
baseUrl: 'http://localhost:8000',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: [ 'browserstack' ],
framework: 'mocha',
reporters: [ 'spec' ],
mochaOpts: { timeout: 60000 },
before: [Function: before],
user: 'xxx',
key: 'xxx',
browserstackLocal: true,
onPrepare: [Function: onPrepare],
onComplete: [Function: onComplete] }
答案 0 :(得分:0)
想出了它...出于某种原因,在wdio.conf.js
中使用此选项后,在我将其删除的那一刻抛出了错误消息,它起作用了,这很生气:
path: '/'