在WebdriverIO上执行TestRunner失败

时间:2018-06-12 10:03:24

标签: javascript node.js webdriver-io

我关注http://webdriver.io/guide.html指南。按照本页的说明执行TestRunner似乎没什么帮助。

我看到的错误:

PS C:\webdriverio-test> .\node_modules\.bin\wdio .\wdio.conf.js

ERROR: connect ECONNREFUSED 127.0.0.1:4444
firefox
    at new RuntimeError (C:\webdriverio-test\node_modules\webdriverio\build\lib\utils\ErrorHandler.js:144:12)
    at Request._callback (C:\webdriverio-test\node_modules\webdriverio\build\lib\utils\RequestHandler.js:330:43)
    at self.callback (C:\webdriverio-test\node_modules\request\request.js:186:22)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at Request.onRequestError (C:\webdriverio-test\node_modules\request\request.js:878:8)
    at emitOne (events.js:121:20)
    at ClientRequest.emit (events.js:211:7)
    at Socket.socketErrorListener (_http_client.js:387:9)
    at emitOne (events.js:116:13)

wdio.conf.js文件:

exports.config = {

    specs: [
        './test/specs/**/*.js'
    ],

    exclude: [
    ],

    maxInstances: 10,

    capabilities: [{
        maxInstances: 5,
        browserName: 'firefox'
    }],

    sync: true,

    // Level of logging verbosity: silent | verbose | command | data | result | error
    logLevel: 'silent',

    coloredLogs: true,

    deprecationWarnings: true,

    bail: 0,

    screenshotPath: './errorShots/',

    baseUrl: 'http://<machine_ip_here>',

    waitforTimeout: 10000,

    connectionRetryTimeout: 90000,

    connectionRetryCount: 3,

    framework: 'mocha',

    reporters: ['dot'],

    mochaOpts: {
        ui: 'bdd'
    },
}

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

  

请在下面查看此答案,然后尝试这样做是否有帮助:

经过研究,可以自己解决此问题。

问题是版本不匹配。

geckoDriver版本为0.20.0,而我使用的Firefox版本为52。

我将Firefox升级到了最新版本。即版本59,并且我能够成功运行测试。

按照geckoDriver版本0.19.0的发行说明

Note that with geckodriver v0.19.0 the following versions are recommended:
Firefox 55.0 (and greater)
Selenium 3.5 (and greater)
So i understood that the higher version also should have the same property.

How to run webdriverio tests on firefox using wdio testRunner and wdio-selenium-standalone-service

谢谢,Naveen