Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting random error from WebDriver - Connection reset by peer #4733

Open
mjaeggi opened this issue Mar 14, 2018 · 6 comments
Open

Getting random error from WebDriver - Connection reset by peer #4733

mjaeggi opened this issue Mar 14, 2018 · 6 comments

Comments

@mjaeggi
Copy link

mjaeggi commented Mar 14, 2018

Bug report

I'm getting the next WebDriver error randomly in different parts of the tests:

WebDriverError: java.net.SocketException: Connection reset by peer (connect failed)

Doesn't matter the action against the browser.

  • Node Version: 8.9.4
  • Protractor Version: 5.3
  • Browser(s): Chrome
  • Selenium: 3.11
  • ChromeDriver: 2.36
  • Operating System and Version: Mac OS - Sierra 10.12.6
  • Your protractor configuration file
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');

const frameworkPath = require.resolve('protractor-cucumber-framework');

module.exports = {
  allScriptsTimeout: 50000,
  seleniumAddress: 'http://localhost:4444/wd/hub',
  baseUrl: '[...]',

  resultJsonOutputFile: 'report.json',
  framework: 'custom',
  frameworkPath,
  capabilities: {
    browserName: 'chrome',
  },
  // How long to wait for a page to load.
  getPageTimeout: 50000,
  onPrepare: () => {
    chai.use(chaiAsPromised);
    // Disable Angular animations so e2e tests run more quickly
    browser.addMockModule('disableNgAnimate', () => {
      angular.module('disableNgAnimate', []).run(($animate) => {
        $animate.enabled(false);
      });
    });

    browser.ignoreSynchronization = true;

    browser.manage().timeouts().implicitlyWait(30000);
    browser.driver.manage().window().setSize(1300, 1000);
  },
  specs: [
    './e2e/features/*/*.feature',
  ],
  SELENIUM_PROMISE_MANAGER: false,
  cucumberOpts: {
    require: './e2e/features/*/*.js',
    format: 'progress-bar',
    keepAlive: false,
  },
};
  • Output from running the test
WebDriverError: java.net.SocketException: Connection reset by peer (connect failed)
           at Object.checkLegacyResponse (/Users/.../node_modules/selenium-webdriver/lib/error.js:546:15)
           at parseHttpResponse (/Users/.../node_modules/selenium-webdriver/lib/http.js:509:13)
           at doSend.then.response (/Users/.../node_modules/selenium-webdriver/lib/http.js:441:30)
           at <anonymous>
           at process._tickCallback (internal/process/next_tick.js:188:7)Error
           at ElementArrayFinder.applyAction_ (/Users/.../node_modules/protractor/built/element.js:459:27)
           at ElementArrayFinder.(anonymous function).args [as getAttribute] (/Users/.../node_modules/protractor/built/element.js:91:29)
           at ElementFinder.(anonymous function).args [as getAttribute] (/Users/.../node_modules/protractor/built/element.js:831:22)
           at HomePage.getFontNameFromCardCarousel (/Users/.../tests/qeguitests/e2e/pages/HomePage.js:91:148)
           at World.When (/Users/.../tests/qeguitests/e2e/features/steps_definitions/homepage_steps.js:99:33)
   - And I move to the "right" the carousel # tests/qeguitests/e2e/features/steps_definitions/homepage_steps.js:54
@pawelus
Copy link

pawelus commented Mar 16, 2018

Duplicate of #4693?
Any getX() operation (eg. getText() or getAttribute()) done on ElementArrayFinder seems to cause this randomly when SELENIUM_PROMISE_MANAGER is set to false.

@mjaeggi
Copy link
Author

mjaeggi commented Mar 16, 2018

Yeah, totally could be duplicated.
For me it's only happening on Chrome, Firefox work good

@brendan-donegan
Copy link

Also seeing this:

Node: 8.11.0
Protractor: 5.3.1
selenium-webdriver: 2.53.43

@kapilchokhawala
Copy link

are you guys sure is this related to Protractor, I am seeing it in WebdriverIO too?

@charlieargue
Copy link

Yup, same here, very intermittent though. Using async/await, but couldn't get .each() or .map() to work at all really, having some luck with .get(#).... like so (still get the same error, but less):

let length:number = await pageTracker.amountButtons.count();
    for(var i =0; i<length; i++) {
      await pageTracker.amountButtons.get(i).click();
    }

Because couldn't just do (like I would like to), because of the above error all the time:

pageTracker.amountButtons.each(async (amountBtn) => await amountBtn.click());

Node: 8.11.1
Protractor: 5.3.3
chromedriver_2.39
selenium-server-standalone-3.12.0.jar

@janjad
Copy link

janjad commented Jun 11, 2018

I'm also getting the error, but at least workaround with lower selenium server version works for me...
See SeleniumHQ/selenium#5611 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants