question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TestCafe is disconnecting from the browser upon login - [ERROR]: browser disconnected. If you did not close the browser yourself, browser performance or network issues may be at fault.

See original GitHub issue

What is your Scenario?

Login to Heroku , reach main page.

The behaviour of the browser with TestCafe differ from regular usage (Tested with multiple browsers and TC versions)

After we will try to login the connection of TC and the browser is lost. TC will try to execute 2 more times till we will fail.

What is the Current behavior?

Fail to login and loopback to login page while testcafe loses the connection to the browser

What is the Expected behavior?

Login will pass and we will reach main Heroku page

What is your public website URL? (or attach your complete example)

https://id.heroku.com/login

What is your TestCafe test code?

import { Selector, ClientFunction } from 'testcafe';

const textinputEmailAddress = Selector('[name=\'email\']');
const textinputPassword = Selector('[name=\'password\']');
const buttonSubmit =  Selector('[type=submit]');
const headingPrimary = Selector('h2').withText('Log in to your account');

fixture `Heroku login failure fixture`
    .page('https://id.heroku.com/login');
test('Login to heroku', async t => {
    await t.expect(headingPrimary.exists).ok('The \'Login\' page title', { timeout: 10000 });
    await t
        .typeText(textinputEmailAddress, ANY-USER, { replace: true, paste: true })
        .typeText(textinputPassword, 'ANY-USER-PASS', { replace: true, paste: true })
        .click(buttonSubmit);
    console.log('click on later button');
    const buttonLater = Selector('button').withText('Later');
    await t.click(buttonLater);
    console.log('verify we looped back to login, instead of reaching https://dashboard.heroku.com/apps');
    await t.expect(headingPrimary.exists).ok('The \'Login\' page title', { timeout: 10000 });
});

Your complete configuration file

no config required in this example: testcafe chrome ./automation/tests/testcafe_disconnect_reproduction.ts

Your complete test report

Heroku login failure fixture "click on later button verify we looped back to login, instead of reaching https://dashboard.heroku.com/apps "click on later button verify we looped back to login, instead of reaching https://dashboard.heroku.com/apps "click on later button verify we looped back to login, instead of reaching https://dashboard.heroku.com/apps ERROR The Chrome 99.0.4844.83 / macOS 10.15.7 browser disconnected. If you did not close the browser yourself, browser performance or network issues may be at fault.

Screenshots

No response

Steps to Reproduce

1.Create a free Heoku user 2.Update credentials in the shorten example I supplied 3.Execute the code example with testcafe chrome ./RELATIVE_PATH/FILE_NAME.ts

TestCafe version

1.18.1 (reproduced with 1.14.1 as well)

Node.js version

12/14/16

Command-line arguments

testcafe chrome ./RELATIVE_PATH/FILE_NAME.ts

Browser name(s) and version(s)

Chrome/FF/Safari

Platform(s) and version(s)

Mac/ubuntu

Other

Adding more debugging info upon failure will be great, why we lost the connection, what can be done to avoid etc.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Artem-Babichcommented, Apr 29, 2022

@yoavws, I confirm that this issue is not reproduced in v1.18.6. We made significant code changes between these versions.

@vlads11, I’m afraid we cannot give you any recommendations. To determine the cause of the issue, we need to reproduce and research it. So, feel free to create a new GitHub issue and share a minimal working example illustrating the problem: How To: Create a Minimal Working Example When You Submit an Issue.

You can use the following template to create the GitHub issue: Issue Template.

We are closing this issue since it is not reproducible in v1.18.6.

1reaction
yoavwscommented, Mar 31, 2022

In another inspection into the exception. It seems the site(Heroku) or some where in hammerhead we get: 2022-03-31T16:26:18.488Z hammerhead:proxy Proxy request peGyY7Sa9 GET /Xrhq9HRjC!s!utf-8/https:/dashboard.heroku.com/assets/dashboard-7637d7a128b471b8fbdef430fedda9dd.map

the proxy crash is seems to be crashing due to the protocol scheme typo: we get https:/ instead of https://

from testcafe execution we get the same:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Headless chrome browser disconnected. This problem may ...
Headless chrome browser disconnected. This problem may appear when a browser hangs or is closed, or due to network.
Read more >
ERROR The Chrome 90.0.4430.212 / Windows 10 browser ...
4430.212 / Windows 10 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues. The...
Read more >
Speed Up Test Execution | Best Practices | Guides - TestCafe
Run Tests Concurrently; Run Tests in Headless Browsers; Use Roles for Login; Set Test Speed; Run Tests in Local Browsers; Mock Requests; Optimize...
Read more >
Configure for UI testing - Azure Pipelines | Microsoft Learn
When running Selenium tests for a web app, you can launch the browser in two ways: Headless mode. In this mode, the browser...
Read more >
WebSocketTimeoutException: Connection Idle Timeout
We first experienced the problem that websocket connections were closed ... Note that when disconnects occurred, there were no network performance issues, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found