ECONNREFUSED after server shutdown with grunt-protractor-runner
Using version 1.0.0 I get an error message that the connection was refused. This is similiar to issue #85. I found someone had similiar issues in http://stackoverflow.com/questions/21382962/when-running-protractor-with-phantomjs-browser-only-able-to-run-tests-once and changed my version to 0.24.2 and the issue went away.
Session deleted: Going to shut down the Selenium server Shutting down Selenium server: http://127.0.0.1:4444 Shut down Selenium server: http://127.0.0.1:4444 (OKOK)
node_modules/protractor/node_modules/selenium-webdriver/http/index.js:136
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.
Clarification - does this only occur using Phantom.js?
@DavidTanner I just updated to v1.0.0, and it started happening exactly the same behavior, and only with phantomJS. @juliemr yes, only with phantomJS, other browsers seems to be working normal :(
@juliemr Yes, just phantomjs and for me only in ubuntu. On Jul 29, 2014 2:54 PM, "JesusLopezCh" [email protected] wrote:
@DavidTanner https://github.com/DavidTanner I just updated to v1.0.0, and star happening exactly the same behavior, and only with phantomJS. @juliemr https://github.com/juliemr yes, only with phantomJS, other browsers seems to be working normal :(
Reply to this email directly or view it on GitHub https://github.com/angular/protractor/issues/1123#issuecomment-50537031.
Facing the same issue with Chrome. It works OK on version 0.24.2. I am running this with grunt task using https://www.npmjs.org/package/grunt-protractor-runner.
How can I downgrade my version, updating the 'package.json' file ?
Just change the version to ~0.24.2 or ^0.24.2 depending on your node version, then npm install to get the version you want.
+1 here with Chrome on both OS X and Ubuntu.
"Needs: more info" - please tell us what more information you need.
+1 with Chrome on Windows 7.
grunt-protractor-runner: ^1.14 grunt-protractor-webdriver: ^0.1.9 protractor: ^1.2.0
+1 with Chrome on Mac OS Lion grunt-protractor-runner: ^1.14
==============(fixed)
I got no error after running webdriver-manager start at first
+1 with Chrome on Mac OS Yosemite grunt-protractor-runner: ^1.1.4 grunt-protractor-webdriver: ^0.1.9 protractor: ^1.4.0
console report https://gist.github.com/orloffv/f255d93c9b577b0f784c
OK - I think there might be multiple issues at work here. Let's ignore the phantom issues - people who aren't using phantom, can you share your configuration? I cannot reproduce this.
i'm running Windows 8.1 x64.
Gruntfile.js =
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
protractor_webdriver: {
e2eUpdate: {
options: {
path: './node_modules/.bin/',
command: 'webdriver-manager update --standalone'
},
},
e2eStart: {
options: {
path: './node_modules/.bin/',
command: 'webdriver-manager start'
},
},
},
protractor: {
options: {
configFile: "ProtractorConfig.js",
keepAlive: true, // If false, the grunt process stops when the test fails.
noColor: false, // If true, protractor will not use colors in its output.
args: {
// Arguments passed to the command
}
},
e2e: {
// Grunt requires at least one target to run so you can simply put 'all: {}' here too.
options: {
configFile: "ProtractorConfig.js", // Target-specific config file
args: {} // Target-specific arguments
}
},
},
});
grunt.loadNpmTasks('grunt-protractor-webdriver');
grunt.loadNpmTasks('grunt-protractor-runner');
// Default task(s).
grunt.registerTask('default', ['protractor_webdriver:e2eStart', 'protractor:e2e']);
};
package.json =
{
"name": "UI.NodeE2ETests",
"version": "1.0.0",
"description": "UI.NodeE2ETests",
"private": false,
"author": "fifteenbelow",
"devDependencies": {
"grunt-protractor-runner": "~1.1.4",
"grunt-protractor-webdriver": "~0.1.9",
"jasmine-reporters": "<2.0.0"
},
"scripts": {
"postinstall": "node_modules/.bin/webdriver-manager update --standalone"
}
}
protractorConfig.js =
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['../src/UI.NodeE2ETests/tests/**/*spec.js'],
multiCapabilities: [,{
browserName: 'chrome'
}],
jasmineNodeOpts: {
onComplete: null,
defaultTimeoutInterval: 180000,
isVerbose: true,
showColors: true,
includeStackTrace: true
},
allScriptsTimeout: 180000,
framework: 'jasmine',
onPrepare: function() {
if (process.env.TEAMCITY_VERSION)
{
require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmine.TeamcityReporter());
}
}
}
Output from tests =
Running "protractor_webdriver:e2eStart" (protractor_webdriver) task
Starting Selenium server
Started Selenium server: http://127.0.0.1:4444
Running "protractor:e2e" (protractor) task
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
Session created: count=1, browserName=chrome
Elements feature
should be able to delete and add a element - pass
Send notification feature
should be able to create and send a manual notification - pass
Signin invalid feature
should not sign in with invalid credentials - pass
Signin feature
should sign in using valid credentials - pass
Templates and Subjects feature
should be able to delete and add a template and delete and add a subject - pas
s
Tenants feature
should display tenants - pass
should be able to select tenant - pass
should be able to switch tenant - pass
Finished in 198.995 seconds
8 tests, 43 assertions, 0 failures
Session deleted: Going to shut down the Selenium server
Shutting down Selenium server: http://127.0.0.1:4444
Shut down Selenium server: http://127.0.0.1:4444 (OKOK)
D:\Git\XXX.AcceptanceTests\build\node_modules\grunt-protractor-runner\node_
modules\protractor\node_modules\selenium-webdriver\http\index.js:145
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (D:\Git\XXX.AcceptanceTests\build\node_mod
ules\grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdr
iver\http\index.js:145:16)
at ClientRequest.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1551:9)
at Socket.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:419:13)
==== async task ====
WebDriver.quit()
at [object Object].webdriver.WebDriver.schedule (D:\Git\XXX.AcceptanceT
ests\build\node_modules\grunt-protractor-runner\node_modules\protractor\node_mod
ules\selenium-webdriver\lib\webdriver\webdriver.js:345:15)
at [object Object].webdriver.WebDriver.quit (D:\Git\XXX.AcceptanceTests
\build\node_modules\grunt-protractor-runner\node_modules\protractor\node_modules
\selenium-webdriver\lib\webdriver\webdriver.js:418:21)
at D:\Git\XXX.AcceptanceTests\build\node_modules\grunt-protractor-runne
r\node_modules\protractor\lib\driverProviders\driverProvider.js:28:16
at D:\Git\XXX.AcceptanceTests\build\node_modules\grunt-protractor-runne
r\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1582:
15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (D:\Git\XXX.AcceptanceTests\build\node_modules\grunt-protractor-runner\node_modules\pro
tractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1654:20)
at notify (D:\Git\XXX.AcceptanceTests\build\node_modules\grunt-protract
or-runner\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\
promise.js:465:12)
at [object Object].then (D:\Git\XXX.AcceptanceTests\build\node_modules\
grunt-protractor-runner\node_modules\protractor\node_modules\selenium-webdriver\
lib\webdriver\promise.js:522:7)
at D:\Git\XXX.AcceptanceTests\build\node_modules\grunt-protractor-runne
r\node_modules\protractor\lib\driverProviders\driverProvider.js:26:25
at Array.map (native)
[launcher] Process exited with error code 1
>>
>> Test failed but keep the grunt process alive.
Note we are running grunt from F# Fake, but this should have no bearing on this error.
If i change my protractorConfig to use
multiCapabilities: [,{
browserName: 'firefox'
}],
then i do not get the error.
I'm beginning to suspect this is an issue with grunt-protractor-runner, since everyone having the problem is using it. Anyone NOT using grunt-protractor-runner have this problem?
Pretty sure you are right @juliemr. Have raised https://github.com/teerapap/grunt-protractor-runner/issues/99
please reference https://github.com/teerapap/grunt-protractor-runner/issues/99 and https://github.com/teerapap/grunt-protractor-runner/issues/100 I managed to resolve this
If any one has got the solution to this problem, please provide the details. I am facing same issue on mac osx.
Running "protractor:webdriver" (protractor) task Using the selenium server at http://localhost/wd/hub [launcher] Running 1 instances of WebDriver ERROR - Unable to start a WebDriver session.
/Users/sjoshi/Documents/SJWorkspace/GDAClientAutomationTest/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:145
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.
Also if there are any specific versions that are compatible and works for you, please specify them.
Looks like this is resolved. Closing.