protractor: Error: ECONNREFUSED connect ECONNREFUSED after Chrome version update

My protractor e2e tests have suddenly stopped working. I’m getting the error:

[15:44:53] I/testLogger - [chrome ANY ANY #01-12] PID: 58628
[chrome ANY ANY #01-12] Specs: /Users/user/Projects/project/src/e2e/tests/test.spec.js
[chrome ANY ANY #01-12]
[chrome ANY ANY #01-12] [15:44:48] I/direct - Using ChromeDriver directly...
[chrome ANY ANY #01-12]
[chrome ANY ANY #01-12] /Users/user/Projects/project/node_modules/selenium-webdriver/http/index.js:365
[chrome ANY ANY #01-12]       onError(new Error(message));
[chrome ANY ANY #01-12]               ^
[chrome ANY ANY #01-12] Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:60998
[chrome ANY ANY #01-12]     at ClientRequest.<anonymous> (/Users/user/Projects/project/node_modules/selenium-webdriver/http/index.js:365:15)
[chrome ANY ANY #01-12]     at emitOne (events.js:90:13)
[chrome ANY ANY #01-12]     at ClientRequest.emit (events.js:182:7)
[chrome ANY ANY #01-12]     at Socket.socketErrorListener (_http_client.js:306:9)
[chrome ANY ANY #01-12]     at emitOne (events.js:90:13)
[chrome ANY ANY #01-12]     at Socket.emit (events.js:182:7)
[chrome ANY ANY #01-12]     at emitErrorNT (net.js:1249:8)
[chrome ANY ANY #01-12]     at _combinedTickCallback (internal/process/next_tick.js:74:11)
[chrome ANY ANY #01-12]     at process._tickCallback (internal/process/next_tick.js:98:9)
[chrome ANY ANY #01-12] From: Task: WebDriver.createSession()
[chrome ANY ANY #01-12]     at acquireSession (/Users/user/Projects/project/node_modules/selenium-webdriver/lib/webdriver.js:62:22)
[chrome ANY ANY #01-12]     at Function.createSession (/Users/user/Projects/project/node_modules/selenium-webdriver/lib/webdriver.js:295:12)
[chrome ANY ANY #01-12]     at Driver (/Users/user/Projects/project/node_modules/selenium-webdriver/chrome.js:778:38)
[chrome ANY ANY #01-12]     at Direct.getNewDriver (/Users/user/Projects/project/node_modules/protractor/built/driverProviders/direct.js:65:26)
[chrome ANY ANY #01-12]     at Runner.createBrowser (/Users/user/Projects/project/node_modules/protractor/built/runner.js:182:43)
[chrome ANY ANY #01-12]     at /Users/user/Projects/project/node_modules/protractor/built/runner.js:255:30
[chrome ANY ANY #01-12]     at _fulfilled (/Users/user/Projects/project/node_modules/q/q.js:834:54)
[chrome ANY ANY #01-12]     at self.promiseDispatch.done (/Users/user/Projects/project/node_modules/q/q.js:863:30)
[chrome ANY ANY #01-12]     at Promise.promise.promiseDispatch (/Users/user/Projects/project/node_modules/q/q.js:796:13)
[chrome ANY ANY #01-12]     at /Users/user/Projects/project/node_modules/q/q.js:556:49

[15:44:53] I/testLogger -

[15:44:53] E/launcher - Runner process exited unexpectedly with error code: 1

My tests worked this morning, and I haven’t made any changes to the config since then. The only thing I can think of is Chrome recently updated to v54. The same failure is happening on multiple machines.

My config:

'use strict';

let HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');

let reporter = new HtmlScreenshotReporter({
  cleanDestination: true,
  showSummary: true,
  showConfiguration: false,
  reportTitle: null,
  showQuickLinks: true,
  dest: './src/e2e/reports',
  filename: 'report.html',
  reportOnlyFailedSpecs: false,
  captureOnlyFailedSpecs: true,
});

exports.config = {
  baseUrl: 'http://localhost:8080/',

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

  specs: [
    './tests/**/*.spec.js'
  ],

  exclude: [],

  suites: {
    *suites*
  },

  framework: 'jasmine2',

  allScriptsTimeout: 110000,

  jasmineNodeOpts: {
    showTiming: true,
    showColors: true,
    isVerbose: false,
    includeStackTrace: false,
    defaultTimeoutInterval: 400000
  },

  directConnect: true,

  capabilities: {
    // Browser options: firefox, chrome
    'browserName': 'chrome',
    'platform': 'ANY',
    'version': 'ANY',
    'chromeOptions': {
      // Get rid of --ignore-certificate yellow warning
      args: ['--no-sandbox', '--test-type=browser'],
      // Set download path and avoid prompting for download even though
      // this is already the default on Chrome but for completeness
      prefs: {
        'download': {
          'prompt_for_download': false,
          'default_directory': '//tmp',
        },
      },
    },
    'loggingPrefs': {
      'driver': 'ALL',
      'server': 'ALL',
      'browser': 'ALL'
    },
    shardTestFiles: 'true',
    maxInstances: 10
  },

  beforeLaunch: function() {
    return new Promise(function(resolve){
      reporter.beforeLaunch(resolve);
    });
  },

  onPrepare: function () {
    let SpecReporter = require('jasmine-spec-reporter');
    let JUnitJasmine = require('jasmine-reporters');
    // add jasmine reporters
    jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: true}));
    jasmine.getEnv().addReporter(reporter);
    jasmine.getEnv().addReporter(
      new JUnitJasmine.JUnitXmlReporter({
        consolidateAll: false,
        savePath: './src/e2e/reports/junit'
      })
    );

    browser.ignoreSynchronization = false;
    require('babel-core/register')({ 'presets': [ 'es2015' ] });
  },

  afterLaunch: function(exitCode) {
    return new Promise(function(resolve){
      reporter.afterLaunch(resolve.bind(this, exitCode));
    });
  },

  /**
   * Angular 2 configuration
   *
   * useAllAngular2AppRoots: tells Protractor to wait for any angular2 apps on the page instead of just the one matching
   * `rootEl`
   *
   */
  useAllAngular2AppRoots: true
};

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 30 (2 by maintainers)

Most upvoted comments

@irushah @mantisbayne @Xotabu4 @nikrolls webdriver-manager was updated yesterday and should download chromedriver 2.24. If you do another npm install, npm should fetch the latest webdriver-manager. Another way to do this is to remove your node_modules folder and reinstall your dependencies. This upgrade path is not obvious and we’ll probably do a hot fix soon.

@sberan downgrading had some positive effects; however, you probably should still stay on 4.0.9+. During your downgrade to 4.0.8, npm probably reinstalled webdriver-manager and got the latest.

Note: this is still an issue in the latest version of protractor (4.0.9). npm install protractor@4.0.8 is merely a workaround to downgrade to the previous version of protractor. This should not be closed.

Note that if you use shrinkwrap, removing node_modules and installing again won’t help you. The broken version of webdriver-manager still satisfies protractor’s version requirement and shrinkwrap will leave it as is. You either need to add webdriver-manager@10.2.5 as a direct dependency or fiddle with your shrinkwrap to use this version.

It seems I’m able to resolve it by forcing webdriver-manager to a newer version. It was failing using 10.2.3 (installing chromedriver@2.22), but when I fiddle with the shrinkwrap and force 10.2.5 (installing chromedriver@2.24) everything works.