Getting random error from WebDriver - Connection reset by peer
See original GitHub issueBug 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
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Random 'The connection was reset' webpage with Selenium
We use selenium to test whether we are able to browse. But sometimes intermittently, the selenium types the actual URL in the address...
Read more >How to Fix the "ERR_CONNECTION_RESET" Error (5 Ways)
The first thing you want to do if you encounter the “ERR_CONNECTION_RESET” error is to determine whether your internet connection is working ...
Read more >How to Fix with java.net.SocketException: Connection reset ...
If you are a client and getting this error while connecting to the server-side application then you can do the following things: 1....
Read more >How does java net SocketException Connection reset happen
Most common issue for this problem occurring is when you close the socket, and then write more data on the output stream. By...
Read more >Fix a random network Connection Reset issue in Docker ...
SocketException: Connection reset by peer: socket write error51 ... a service served by ClusterIP gets a random “connection reset”.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
I’m also getting the error, but at least workaround with lower selenium server version works for me… See https://github.com/SeleniumHQ/selenium/issues/5611#issuecomment-396268295