Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The chromedriver is not working and getting ERROR: connect ECONNREFUSED 127.0.0.1:4444 in webdriverio frame work

I am using webdriverIO Mocha frame work and i tried many solution but still getting the below error. So help me resolve this issue

[23:57:52]  COMMAND     POST     "/wd/hub/session" [23:57:52]  DATA                {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"firefox","platform":"macOS
10.12","version":"latest","build":"MAC_CHROME","pageLoadStrategy":"normal","acceptSslCerts":true,"_":"2 more keys: [\"loggingPrefs\",\"requestOrigins\"]"}} ERROR: connect ECONNREFUSED 127.0.0.1:4444
like image 469
user2641604 Avatar asked Jan 24 '26 10:01

user2641604


2 Answers

The best practice is to use "selenium-standalone" and "wdio-selenium-standalone-service" npm packages, so if you don't have them in devDependencies in your package.json, add them.

Once you have these packages, you need first to download and install selenium drivers with console command: ./node_modules/.bin/selenium-standalone install --config=./config/selenium.config.js, where your selenium.config.js file should look like this .

Once installed, the "wdio-selenium-standalone-service" will automatically start the node server for you each time before tests start (if you use wdio testrunner)

like image 161
Tomas Avatar answered Jan 26 '26 23:01

Tomas


I also face the problem of Error: connect ECONNREFUSED 127.0.0.1:4444. Try many ways like: update Chrome, update ChromeDriver, set environment Path, but still doesn't work. Then, I update my Java runtime, now it can work now.

like image 38
mrquan1506 Avatar answered Jan 27 '26 01:01

mrquan1506



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!