3
votes

Configuration Used:

OS : Windows 7

Node : 6.11.3

Protractor : 5.1.2

NPM : 3.10.10

I am unable to run the Protractor test because of the below error.

C:\Users\Admin>protractor conf.js [14:45:16] I/launcher - Running 1 instances of WebDriver [14:45:16] I/hosted - Using the selenium server at http://localhost:4444/wd/hub [14:45:18] E/launcher - Error code: 135 [14:45:18] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0 .1:4444 [14:45:18] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444 at ClientRequest. (C:\Users\Admin\AppData\Roaming\npm\node_module s\protractor\node_modules\selenium-webdriver\http\index.js:238:15) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at Socket.socketErrorListener (_http_client.js:310:9) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at emitErrorNT (net.js:1277:8) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) From: Task: WebDriver.createSession() at Function.createSession (C:\Users\Admin\AppData\Roaming\npm\node_modules\p rotractor\node_modules\selenium-webdriver\lib\webdriver.js:777:24) at Function.createSession (C:\Users\Admin\AppData\Roaming\npm\node_modules\p rotractor\node_modules\selenium-webdriver\chrome.js:709:29) at createDriver (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\ node_modules\selenium-webdriver\index.js:167:33) at Builder.build (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor \node_modules\selenium-webdriver\index.js:623:16) at Hosted.getNewDriver (C:\Users\Admin\AppData\Roaming\npm\node_modules\prot ractor\lib\driverProviders\driverProvider.ts:60:29) at Runner.createBrowser (C:\Users\Admin\AppData\Roaming\npm\node_modules\pro tractor\lib\runner.ts:225:39) at q.then.then (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\l ib\runner.ts:391:27) at _fulfilled (C:\Users\Admin\AppData\Roaming\npm\node_modules\protractor\no de_modules\q\q.js:834:54) at self.promiseDispatch.done (C:\Users\Admin\AppData\Roaming\npm\node_module s\protractor\node_modules\q\q.js:863:30) at Promise.promise.promiseDispatch (C:\Users\Admin\AppData\Roaming\npm\node_ modules\protractor\node_modules\q\q.js:796:13) [14:45:18] E/launcher - Process exited with error code 135

Mention any other details that might be useful.

I am trying to run the protractor test from my windows machine. I get the above error, please help!!

5
did you run Selenium server? If not then you should run it using webdriver-manager start. If it is not installed use npm install -g webdriver-manager.Tarun Lalwani
Thank you very much for given a reply -- Yeah i tried then i got the error sir.ThirupaTI
Thank you for reply my question -- Yeah, i tried but i got the error sir. C:\Users\Admin>webdriver-manager start webdriver-manager: using global installed version 12.0.6 C:\Users\Admin\AppData\Roaming\npm\node_mo dules\webdriver-manager\selenium\selenium-server-standalone-3.5.3.jar -port 4444 [16:12:03] I/start - seleniumProcess.pid: undefined [16:12:03] W/start - Selenium Standalone server encountered an error: Error: spa wn cmd ENOENTThirupaTI
Try with admin rights in terminal and see if it helps?Tarun Lalwani
Yeah,i had done all of the stuff through Admin only Sir.ThirupaTI

5 Answers

7
votes

Try doing below steps:-

Open cmd and in the home path use below commands.

webdriver-manager clean
webdriver-manager status
webdriver-manager update
webdriver-manager start.
2
votes

It looks like You can't connect to the selenium server. Comment this :

seleniumAddress: 'http://localhost:4444/wd/hub'

and replace it with:

directConnect: true,

just to check if is working directly. Also You can navigate directly to http://localhost:4444/wd/hub to see If you can access there. If not it might be some firewall or something similar.

1
votes

First, open a command prompt and then run the following command:

webdriver-manager start

Open a second command prompt then enter your command. Mine is protractor conf.js

0
votes

Probably a bit late but I get this error when I fail to start server for web-driver using:

webdriver-manager start

0
votes

Update the chrome driver using the command => webdriver-manager update --versions.chrome <73.0.3683.68>

after upgrading just install node modules once again using cmd => npm install