1

I am trying to add some scripts to package.json to run Protractor tests:

"scripts": {
    "webdriver-update": "./node_modules/.bin/webdriver-manager update",
    "webdriver-start": "./node_modules/.bin/webdriver-manager start --versions.chrome=84.0.4147.30",
    "protractor": "./node_modules/.bin/protractor configuration.js",
    "start": "npm run webdriver-update &&npm run webdriver-start"
}

If I open 2 command prompts & run npm run start & npm run protractor, my tests run fine.

In the tutorial I am following, they are able to just run npm run protractor & the tests also run.

However, when I try that then I get this error message:

protractor configuration.js
[21:01:19] I/launcher - Running 1 instances of WebDriver
[21:01:19] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[21:01:21] E/launcher - Error code: 135
[21:01:21] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
[21:01:21] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444

Can someone please tell me why this isn't working for me?

RobC
  • 22,977
  • 20
  • 73
  • 80
user9847788
  • 2,135
  • 5
  • 31
  • 79

1 Answers1

1

Your webdriver-manager must run in a separate terminal and then you must start the test.

Run npm run webdriver-start in one terminal and let it run.

Later run npm run protractor in another terminal to start the tests.

Bharath Kumar S
  • 1,410
  • 2
  • 10
  • 29