1

I am doing e2e testing using protractor of one of my page and some time I get Failed: ETIMEDOUT connect ETIMEDOUT 127.0.0.1:56018 error.

Some time it also passes without any error. I have no clue whats going on!

The full error:

Failed: ETIMEDOUT connect ETIMEDOUT 127.0.0.1:56018
Error: ETIMEDOUT connect ETIMEDOUT 127.0.0.1:56018
at ClientRequest.<anonymous> (/Users/pro1/node_modules/selenium-webdriver/http/index.js:238:15)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:401:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)Error
at ElementArrayFinder.applyAction_ (/Users/pro1/node_modules/protractor/lib/element.ts:482:23)
at ElementArrayFinder.(anonymous function).args [as getText] (/Users/pro1/node_modules/protractor/lib/element.ts:96:21)
at ElementFinder.(anonymous function).args [as getText] (/Users/pro1/node_modules/protractor/lib/element.ts:873:14)
at /Users/pro1/e2e/app/data-entity/sme/sme.e2e-spec.ts:107:37
at step (/Users/pro1/e2e/app/data-entity/sme/sme.e2e-spec.ts:47:23)
at Object.next (/Users/pro1/e2e/app/data-entity/sme/sme.e2e-spec.ts:28:53)
at fulfilled (/Users/pro1/e2e/app/data-entity/sme/sme.e2e-spec.ts:19:58)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From asynchronous test:
    Error
at Suite.<anonymous> (/Users/pro1/e2e/app/data-entity/sme/sme.e2e-spec.ts:62:3)
at addSpecsToSuite (/Users/pro1/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1107:25)
at Env.describe (/Users/pro1/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:1074:7)
at describe (/Users/pro1/node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js:4399:18)
at Object.<anonymous> (/Users/pro1/e2e/app/data-entity/sme/sme.e2e-spec.ts:30:1)
at Module._compile (module.js:624:30)
at Module.m._compile (/Users/pro1/node_modules/ts-node/src/index.ts:392:23)
at Module._extensions..js (module.js:635:10)
at Object.require.extensions.(anonymous function) [as .ts] (/Users/pro1/node_modules/ts-node/src/index.ts:395:12)
Aniruddha Das
  • 20,520
  • 23
  • 96
  • 132

2 Answers2

0

This error usually occurs when Protractor cannot connect to your local Selenium Server. If you are sure your Selenium Server is running on port 56018, then you may be having network issues that are not associated with Protractor. In your spec.conf.js file, I would update to use the default 4444 port, for both Selenium and Protractor for testing purposes.

// spec.conf.js file
exports.config = {
    seleniumAddress: "http://127.0.0.1:4444/wd/hub"
    ...
}

// Command-line: Selenium through Protractor's webdriver-manager
webdriver-manager update
webdriver-manager start

// Command-line: Selenium through standalone
java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/bin/selenium-server-standalone-3.4.0.jar -port 4444
GoLGo13
  • 81
  • 5
  • after updating `seleniumAddress: "http://127.0.0.1:4444/wd/hub"` still getting the same issue – Aniruddha Das Oct 04 '17 at 20:55
  • You need to change both the **spec.conf.js** file configuration and the actual Selenium Server configuration that is done depending how you start the server. I gave two examples above. – GoLGo13 Oct 04 '17 at 21:12
  • `// Command-line: Selenium through Protractor's webdriver-manager webdriver-manager update webdriver-manager start` I have followed this approach and made changed as you suggested – Aniruddha Das Oct 04 '17 at 21:13
  • When you run **webdriver-manager start** it should tell you what port it is running on. It should be 4444. 14:32:21.597 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub – GoLGo13 Oct 04 '17 at 21:32
  • yes, `server-standalone-3.6.0.jar -port 4444 [16:57:30] I/start - seleniumProcess.pid: 10132 ` – Aniruddha Das Oct 04 '17 at 21:59
0

This error occur when selenium server is not able to start or Protractor cannot connect to your local Selenium Server. Well if you are testing your App with Google Chrome, you can use

// spec.conf.js file
exports.config = {
    directConnect:true
}

in your conf.js file. It will ignore all selenium server settings. And will start your test with chrome drivers directly.

Vikas Gupta
  • 1,183
  • 1
  • 10
  • 25