Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium webdriver exits with error code 135

I am new to protractor. I am getting the following error while trying to run Selenium tests using protractor

I/hosted - Using the selenium server at http://localhost:4444/wd/hub
I/launcher - Running 1 instances of WebDriver
E/launcher - Error code: 135
E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:4444
at ClientRequest.<anonymous>  (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:381:15)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:267:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1269:8)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
From: Task: WebDriver.createSession()
at Function.createSession  (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:329:24)
at Builder.build (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\builder.js:458:24)
at Hosted.DriverProvider.getNewDriver (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\driverProvider.js:37:33)
at Runner.createBrowser (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\built\runner.js:187:43)
at c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\built\runner.js:261:30
at _fulfilled (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (c:\Users\SavDevService.SAVISIONLAB\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13)
E/launcher - Process exited with error code 135

I checked to see if any other process is listening to port 4444, but did not find any. also I am running web driver with --standalone flag.

like image 963
Farhana rahman Avatar asked Sep 06 '16 16:09

Farhana rahman


2 Answers

It seems like selenium server is not running on http://127.0.0.1:4444/wd/hub. Before running your protractor test,you must start the selenium server using below command.webdriver-manager start. After starting the server your tests will execute without any errors.

If you dont want to start selenium server manually,then just remove seleniumAddress:http://localhost:4444/wd/hub property from your conf.js.

like image 100
Sudharsan Selvaraj Avatar answered Sep 24 '22 14:09

Sudharsan Selvaraj


You can also add these lines to your conf.js file:

chromeOnly: true,
directConnect: true,
like image 26
Slava Babin Avatar answered Sep 23 '22 14:09

Slava Babin