webdriverio: @wdio/runner: FetchError: Failed to fetch browser webSocket URL from http://localhost:51804/json/version: request to http://localhost:51804/json/version failed, reason: connect ECONNREFUSED ::1:51804๐ Bug]:
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
7.16.15
Node.js Version
v17.9.0
Mode
WDIO Testrunner
Which capabilities are you using?
capabilities: [
{
maxInstances: 1,
browserName: "Chrome",
"goog:chromeOptions": {
args: ["--headless"],
},
},
],
What happened?
after starting to work react-native project then I am getting this error while running webdriverio project
running API with cucumber
What is your expected behavior?
No error should occur.
How to reproduce the bug.
This is happening randomly.
Relevant log output
wdio@1.0.0 test-api
> ./node_modules/.bin/wdio run ./config/local/wdio.api.config.js --cucumberOpts.tagExpression "@CartService"
Execution of 6 workers started at 2022-04-26T16:27:52.014Z
2022-04-26T16:27:52.025Z INFO @wdio/cli:launcher: Run onPrepare hook
2022-04-26T16:27:52.027Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2022-04-26T16:27:52.028Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,./config/local/wdio.api.config.js,--cucumberOpts.tagExpression,@CartService
[0-0] 2022-04-26T16:27:52.424Z INFO @wdio/local-runner: Run worker command: run
2022-04-26T16:27:54.086Z INFO @wdio/cli: [0-0] SKIPPED in Chrome - /test/api/features/login.feature
2022-04-26T16:27:54.086Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2022-04-26T16:27:54.087Z INFO @wdio/local-runner: Start worker 0-1 with arg: run,./config/local/wdio.api.config.js,--cucumberOpts.tagExpression,@CartService
[0-1] 2022-04-26T16:27:54.298Z INFO @wdio/local-runner: Run worker command: run
[0-1] RUNNING in Chrome - /test/api/features/cart.feature
[0-1] 2022-04-26T16:27:55.765Z INFO devtools:puppeteer: Initiate new session using the DevTools protocol
[0-1] 2022-04-26T16:27:55.766Z INFO devtools: Launch Google Chrome with flags: --enable-automation --disable-popup-blocking --disable-extensions --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --no-default-browser-check --disable-hang-monitor --disable-prompt-on-repost --disable-client-side-phishing-detection --password-store=basic --use-mock-keychain --disable-component-extensions-with-background-pages --disable-breakpad --disable-dev-shm-usage --disable-ipc-flooding-protection --disable-renderer-backgrounding --force-fieldtrials=*BackgroundTracing/default/ --enable-features=NetworkService,NetworkServiceInProcess --disable-features=site-per-process,TranslateUI,BlinkGenPropertyTrees --window-position=0,0 --window-size=1200,900 --headless
[0-1] 2022-04-26T16:27:56.799Z INFO devtools: Connect Puppeteer with browser on port 60144
[0-1] 2022-04-26T16:27:56.817Z ERROR @wdio/runner: FetchError: Failed to fetch browser webSocket URL from http://localhost:60144/json/version: request to http://localhost:60144/json/version failed, reason: connect ECONNREFUSED ::1:60144
[0-1] at ClientRequest.<anonymous> (/Users/sayrah/Desktop/decathlonauto/WebDriverIo/dosa-autobot/node_modules/node-fetch/lib/index.js:1491:11)
[0-1] at ClientRequest.emit (node:events:527:28)
[0-1] at ClientRequest.emit (node:domain:475:12)
[0-1] at Socket.socketErrorListener (node:_http_client:454:9)
[0-1] at Socket.emit (node:events:527:28)
[0-1] at Socket.emit (node:domain:475:12)
[0-1] at emitErrorNT (node:internal/streams/destroy:164:8)
[0-1] at emitErrorCloseNT (node:internal/streams/destroy:129:3)
[0-1] at processTicksAndRejections (node:internal/process/task_queues:83:21)
[0-1] FAILED in Chrome - /test/api/features/cart.feature
Code of Conduct
- I agree to follow this projectโs Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 29 (7 by maintainers)
Commits related to this issue
- Run WDIO on Node 14 and 16 as v18 is not fully supported yet - webdriverio/webdriverio#8279 — committed to serenity-js/serenity-js-cucumber-webdriverio-template by jan-molak 2 years ago
- Fix watch mode erroring after change and stopping tests https://github.com/webdriverio/webdriverio/issues/8279\#issuecomment-1295996734 An error (different from before) gets logged in the console, b... — committed to alphagov/govuk-frontend by romaricpascal a year ago
- Fix watch mode erroring after change and stopping tests https://github.com/webdriverio/webdriverio/issues/8279\#issuecomment-1295996734 An error (different from before) gets logged in the console, b... — committed to alphagov/govuk-frontend by romaricpascal a year ago
- ci(github): run WebdriverIO tests on Node 16 as WebdriverIO v7 doesn't support Node 18 Related tickets: webdriverio/webdriverio#8279 — committed to serenity-js/serenity-js by jan-molak a year ago
- ci(github): run WebdriverIO tests on Node 16 as WebdriverIO v7 doesn't support Node 18 Related tickets: webdriverio/webdriverio#8279 — committed to serenity-js/serenity-js by jan-molak a year ago
The following config hook fixed it for me:
Hi all. We had the same issue since working with node v18.12.1 and the mentioned beforeSession hook fixed the problem in our case. Upgrading to Webdriver v8 seems to require a big refactoring for us because of the switch do ES Module.
Worked for me. node 19.2.0 macOS 12.6
I had the same issue after upgrade to node 18.18.0 (the current LTS) The issue seems to be solved after iโve upgraded to the latest wdio versions - 8.16.15 Fingers crossed!
You can use WebdriverIO v8 within CJS projects as well.
It is a Node.js module, e.g.
This also occurred for me on my local machine in node 18.3.0. I ran an npm update and the issue went away locally.
After pushing my code to our bitbucket pipelines itโs occurring once again. I also tried on node v17, and had the same result (see below)
My current work around was to downgrade to 16.17.0.