Search code examples
javascriptwebdriver-ioselenoid

Getting error on attempt to work with ggr+selenoid: ECONNREFUSED 127.0.0.1:443


for my own ggr+selenoid cluster (https://test:[email protected]:443/wd/hub/session) . Creating session with curl works fine.

It seems like issue https - it tries connect to localhost:443, but throws error for my ggr url

WebdriverIO version: v7 Mode: WDIO Testrunner If WDIO Testrunner, running sync/async: sync Node.js version: v12.22 NPM version: 6.14.11

"@wdio/allure-reporter": "^7.5.7",
"@wdio/cli": "^7.5.7",
"@wdio/local-runner": "^7.5.7",
"@wdio/mocha-framework": "^7.5.3",
"@wdio/spec-reporter": "^7.5.7",

  runner: 'local',
  protocol: 'https',
  user: 'test',
  key: '123456',
  hostname: 'ggr.my.server.com',
  port: 443,
  path: '/wd/hub/',

[0-0] 2021-06-18T11:32:49.065Z ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:443
[0-0]     at ClientRequest.<anonymous> (/Users/.../Documents/project/web-tests-wdio/node_modules/got/dist/source/core/index.js:956:111)
[0-0]     at Object.onceWrapper (node:events:476:26)
[0-0]     at ClientRequest.emit (node:events:381:22)
[0-0]     at ClientRequest.emit (node:domain:470:12)
[0-0]     at ClientRequest.origin.emit (/Users/.../Documents/project/web-tests-wdio/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
[0-0]     at TLSSocket.socketErrorListener (node:_http_client:472:9)
[0-0]     at TLSSocket.emit (node:events:369:20)
[0-0]     at TLSSocket.emit (node:domain:470:12)
[0-0]     at emitErrorNT (node:internal/streams/destroy:188:8)
[0-0]     at emitErrorCloseNT (node:internal/streams/destroy:153:3)
[0-0]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1138:16)

[0-0] 2021-06-18T11:32:49.065Z ERROR @wdio/runner: Error: Failed to create session.
[0-0] Unable to connect to "https://ggr.my.server.com:443/wd/hub/", make sure browser driver is running on that address.
[0-0] If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-0]     at Object.startWebDriverSession (/Users/.../web-tests-wdio/node_modules/webdriver/build/utils.js:68:15)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:94:5)
[0-0]     at Function.newSession (/Users/.../web-tests-wdio/node_modules/webdriver/build/index.js:58:45)
[0-0]     at Object.remote (/Users/.../web-tests-wdio/node_modules/webdriverio/build/index.js:67:22)
[0-0]     at Runner._startSession (/Users/.../web-tests-wdio/node_modules/@wdio/runner/build/index.js:216:56)
[0-0]     at Runner._initSession (/Users/.../web-tests-wdio/node_modules/@wdio/runner/build/index.js:172:25)
[0-0]     at Runner.run (/Users/.../web-tests-wdio/node_modules/@wdio/runner/build/index.js:87:19)

Solution

  • Ok for someone that will be looking for solution in future:

    In my project in some deep files i had (we are currently in migration phase)

    import { browser } from 'protractor'
    

    For some reason, some of protractor dependencies, or protractor itself changes behaviour of how webdriverio connects to remote https selenoid, and gives pretty unclear error that i posted in question.

    Avoid working with dependenices that change global http/https modules behaviour.

    This issue pointed that i should check my dependencies: https://github.com/sindresorhus/got/issues/1572