Selenium & Heroku: urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) Selenium & Heroku: urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) python-3.x python-3.x

Selenium & Heroku: urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))


This error message...

urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

...implies that the ChromeDriver in Headless mode was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

Some information regarding the versions of the binaries you are using would have helped us to analyze the error in a better way. However, this issue of urllib3 can be obseved due to several reasons as mentioned below:

This flag is no longer necessary on Linux or macOS. It will become unnecessary on Windows as soon as SwiftShader fails an assert on Windows in headless mode gets fixed.

Solution

  • Upgrade ChromeDriver to current ChromeDriver v2.44 level.
  • Keep Chrome version between Chrome v69-71 levels. (as per ChromeDriver v2.44 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test.