Chrome: 47.0.2526.111 (Official Build) m (64-bit)
Protractor: 3.0.0
asyncawait: 2.14.7
Not an angular project
I'm receiving this error about 1 in every 50 test suite runs.
To simplify the syntax for handling asynchronous tasks for some of the less technical on my team, I'm using async/await. A typical test might look something like this:
it('should do the asynchronous task', async(function () {
var result = await(doTheTask());
expect(result).toBe('It Worked');
}));
I previously was using Jasmine's done in these tests, like so:
it('should do the asynchronous task', async(function (done) {
var result = await(doTheTask());
expect(result).toBe('It Worked');
done()
}));
Unfortunately, this was causing issues where tests would be given a false positive pass even though one or more expects actually failed. Removing the dones seemed to resolve this for all of my tests.
Here's the stack trace when running locally with directConnect enabled:
C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:174
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:58515
at ClientRequest.<anonymous> (C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:174:16)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:259:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at emitErrorNT (net.js:1253:8)
at doNTCallback2 (node.js:441:9)
at process._tickCallback (node.js:355:17)
From: Task: WebDriver.executeScript()
at [object Object].webdriver.WebDriver.schedule (C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:362:15)
at [object Object].webdriver.WebDriver.executeScript (C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:533:15)
at C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\locators.js:158:33
at C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1890:15
at C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:648:17
at [object Object].promise.Promise.goog.defineClass.invokeCallback_ (C:/Users/me/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ (C:/Users/me/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (C:/Users/me/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21)
at goog.async.run.processWorkQueue (C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:124:15)
From: Task: WebDriver.call(function)
at [object Object].webdriver.WebDriver.call (C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:642:15)
at [object Object].webdriver.WebDriver.findElementsInternal_ (C:\Users\ngibson\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:1017:15)
at [object Object].webdriver.WebDriver.findElements (C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:997:17)
at Object.findElementsOverride (C:\Users\me\AppData\Roaming\npm\node_modules\protractor\lib\locators.js:391:21)
at C:\Users\me\AppData\Roaming\npm\node_modules\protractor\lib\element.js:135:26
at [object Object].promise.Promise.goog.defineClass.invokeCallback_ (C:/Users/me/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ (C:/Users/me/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (C:/Users/me/AppData/Roaming/npm/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21)
at goog.async.run.processWorkQueue (C:\Users\me\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:124:15)
[launcher] Process exited with error code 1
Seems like a duplicate of #2628?
No, this is error is different and is occurring with a different setup, though they may very well be related. I put them in as separate issues because of the differences.
Looks like a problem with your connection to the selenium server. Can you share your configuration file and any relevant logs from your selenium server?
This is occurring without running a separate Selenium server instance. My configuration is as follows:
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
framework: 'jasmine2',
//seleniumAddress: 'http://0.0.0.0:4444',
// add proper version number
seleniumServerJar: require('selenium-server-standalone-jar').path,
specs: ['test/e2e/suites/**/*.js'],
plugins: [{
path: 'test/e2e/plugins.protractor.js'
}],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 450000,
isVerbose: true,
print: function() {}
},
onPrepare: function () {
var CustomReporter = require('./test/e2e/helpers/custom-reporter');
jasmine.getEnv().addReporter(CustomReporter());
var SpecReporter = require('jasmine-spec-reporter');
jasmine.getEnv().addReporter(new SpecReporter());
var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
jasmine.getEnv().addReporter(new HtmlScreenshotReporter({
reportOnlyFailedSpecs: false,
captureOnlyFailedSpecs: true,
dest: './results'
}));
beforeEach(function() {
jasmine.addMatchers(require('./custom.matchers'));
});
}
};
Is there some way to get additional logging from it? My understanding was that directConnect does not spawn a separate selenium server instance, so there would be no selenium server logs.
OK. I think this is probably just an issue with your setup/machine, but I'm not sure how asyncawait might play into the mix. Can you run against a chromedriver server running in another process and post the chromedriver logs?
You can do this by running ./selenium/chromedriver --verbose from your protractor directory. It will start up a server at localhost:9515. Then set seleniumAddress: http://localhost:9515 in your protractor configuration.
Closing this as out of date - please open a new issue if you are still seeing problems with the latest version of Protractor.
I have the same issue and I can't run the tests again.
+1
+1
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:61365' getting the issue on latest version of protractor randomly
I have to click on next button util it gets disabled, approx 90 times, it fails after clicking next at 45 time , sometimes at 10th, sometimes after first click only and gives the above error
Most helpful comment
I have the same issue and I can't run the tests again.