testcafe: Browser hangs / disconnects when running testcafe tests on docker

Are you requesting a feature or reporting a bug?

Reporting a bug

What is the current behavior?

Testcafe crashes/disconnects to browser when clicking a link that loads or opens another page. Or when the page is loading a list of elements.

ERROR The HeadlessChrome 63.0.3239 / Linux 0.0.0 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.

What is the expected behavior?

Continue test on that page

How would you reproduce the current behavior (if this is a bug)?

  1. create a trial account (pm me for details)
  2. Run a testcafe test on docker image using chromium.
  3. Test the Trial Period header link on top right and it will load a page where you will be directed with a plans page.
  4. Test page (normally the error on disconnect browser occurs after page is loaded)

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code


Specify your

  • operating system: MAC OS X 10.13.3
  • testcafe version: 0.18.7-dev20180206
  • node.js version: 5.6.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 14
  • Comments: 21 (1 by maintainers)

Most upvoted comments

@meraj-ahmed looks like that really helped our pipeline to become stable. So instead of using testcafe call, we just start chrome with command line params setting up the resolution

We’re also facing this issue intermittently on our CI machines. We’re running Chrome beta.


2018-03-08T22:20:46.8490380Z Error: The HeadlessChrome 0.0.0 / Mac OS X 10.13.2 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.
2018-03-08T22:20:46.8523930Z     at Timeout.<anonymous> (/Users/agent/2.129.1/work/1/s/node_modules/testcafe/lib/browser/connection/index.js:225:34)
2018-03-08T22:20:46.8551560Z     at ontimeout (timers.js:386:11)
2018-03-08T22:20:46.8579960Z     at tryOnTimeout (timers.js:250:5)
2018-03-08T22:20:46.8606310Z     at Timer.listOnTimeout (timers.js:214:5)

I am still experience this issue, can anyone provided the solution for this issue ?

I received a similar error after adding a .maximizeWindow() call to the test. Removing that was the only way to fix it in my case.

Our test suite does not include multiple window test cases, but we also get browser disconnected errors running in Docker.

ERROR The HeadlessChrome 0.0.0 / Linux 0.0.0 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.

@miherlosev what can you recommend to troubleshoot the browser <browser-name> disconnected. … issue?

The question about debugging still stands. What are the ways to debug this? cc @miherlosev

Note: We get this error in random order, after different tests, so I don’t consider it related to specific test cases.