我正在遵循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'
    },
}


我想念什么吗?

最佳答案

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


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

问题是版本不匹配。

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

关于javascript - 在WebdriverIO上执行TestRunner失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50814445/

10-09 17:32