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

Unable to run native tests in chrome/edge #8350

Open
emmabDF opened this issue Dec 10, 2024 · 6 comments
Open

Unable to run native tests in chrome/edge #8350

emmabDF opened this issue Dec 10, 2024 · 6 comments
Assignees
Labels
STATE: Need response An issue that requires a response or attention from the team. TYPE: bug The described behavior is considered as wrong (bug).

Comments

@emmabDF
Copy link

emmabDF commented Dec 10, 2024

What is your Scenario?

Run any tests on testcafe

What is the Current behavior?

Testcafe fails to open with error

ERROR Unable to open the "chrome:" browser due to the following error:

Error: connect ECONNREFUSED ::1:54735
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1615:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)

What is the Expected behavior?

Testcafe opens and runs test

What is the public URL of the test page? (attach your complete example)

N/A any URL

What is your TestCafe test code?

import { Selector, t } from 'testcafe';

fixture('Basic testcafe example')
.page('www.example.com');

test('Do anything', async t => {
await t.click(Selector('a'))
});

Your complete configuration file

n/a

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

1.Run any testcafe test

TestCafe version

3.7.0

Node.js version

22.11.0

Command-line arguments

npx testcafe chrome test\basicTest.js

Browser name(s) and version(s)

chrome 131.0.6778.109

Platform(s) and version(s)

Windows 11 Pro

Other

This is happening for about 50% of our team, with some users experiencing the issue & others not - there does not seem to be any correlation with node/chrome versions and having/not having this issue.

Those experiencing the issue can run tests in testcafe if using --disable-native-automation

This issue happens in edge and chrome, headed or headless.
This issue does not happen in firefox.

This seems to have started today.

Any further information I can provide, please let me know.

@emmabDF emmabDF added the TYPE: bug The described behavior is considered as wrong (bug). label Dec 10, 2024
@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Dec 10, 2024
@PavelMor25
Copy link
Collaborator

Hello @emmabDF,

I couldn't reproduce the issue. Without accurately reproducing the issue, it's difficult to determine exactly what goes wrong.

Could you please try running TestCafe with a debug log?

To enable the debug log, you can do the following:

set DEBUG=testcafe:*,hammerhead:*
testcafe chrome index.js 2> testcafe.log

Before running TestCafe, set the DEBUG environment variable as shown above. Then, run TestCafe and redirect the output to a file.

Please refer to the following help topic for details: https://testcafe.io/documentation/402636/faq/general-info#related-questions

@PavelMor25 PavelMor25 added STATE: Need clarification An issue lacks information for further research. and removed STATE: Need response An issue that requires a response or attention from the team. labels Dec 16, 2024
@lmsalopek
Copy link

lmsalopek commented Dec 17, 2024

I am seeing the same issue
ERROR Unable to open the "chrome:" browser due to the following error:

Error: connect ECONNREFUSED ::1:60899
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1615:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)

For firefox:
image

The test then fails with a selector not found error even though it never connected to the website
(All my tests run external to the website, ie... e2e scripts)

I've doubled checked my hosts file and both localhost v4 and v6 are defined.
I've tried with and without native enabled - same type of results as running with firefox.
I even tried specifying the hostname in the config file - no change

I have to request special permission to run anything as admin, but I will try and run with debug turned on and see if I can collect more information.

Other details:

  • Using Visual Studio Code 1.96 with testcafe test runner extension
  • testcafe version 3.7
  • node v22
  • windows 11

Following the FAQ, I created a simple test - same results as above

import { t, fixture, test, Selector } from 'testcafe';

const page = 'https://devexpress.github.io/testcafe/example/';

fixture('TestCafe');

test.page(page)('TestCafe Example Test for Troubleshooting', async (tn) => {
if (await t.exists(Selector('#main-form > div > header > h1'))) {
await t.typeText(Selector('#developer-name'), 'My Name Here', { replace: true, paste: true });
}
});

Update:
Ran it in our CI/CD pipeline (linux) and it connected to the testcafe test site - no errors.
Same configuration and commandline in windows - fails.

I cannot test on MacOS, but it appears Macs are okay (most of our automation engineers run on Macs)

More Updates:
Automation Engineers running windows on VM appear to be fine.
I am connecting to the website environment on a Full v6 VPN

My fear this is a' down deep in the weeds' localhost issue :-(

@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Dec 17, 2024
@emmabDF
Copy link
Author

emmabDF commented Dec 18, 2024

Heya, we have tried to run in debug mode, but aren't getting any logs back. Unless I am doing something wrong here

image (2)

@github-actions github-actions bot removed the STATE: Need clarification An issue lacks information for further research. label Dec 18, 2024
@PavelMor25
Copy link
Collaborator

Hello everyone,

We are investigating this issue to identify its potential cause. Unfortunately, we haven't been able to reproduce it so far.

Could you please reinstall your browser and test this again? If you could share any additional information that might help us replicate the issue, it would be greatly appreciated.

Thank you for your understanding.

@PavelMor25 PavelMor25 removed the STATE: Need response An issue that requires a response or attention from the team. label Dec 25, 2024
@PavelMor25 PavelMor25 self-assigned this Dec 26, 2024
@emmabDF
Copy link
Author

emmabDF commented Jan 2, 2025

Heya @PavelMor25 thanks for suggesting that, and apologies for not responding for a while, I have been on holiday from work.

Some things we have tried with no luck:

  • uninstalling & reinstalling browsers
  • uninstalling & reinstalling node
  • Have also tried on the latest version of testcafe 3.7.1
  • Changing the port & hostname configs
  • Local admin rights

We also have done a wireshark capture and given this to our IT team who have seen nothing unusual.

The IT team thought the problem is either Testcafe cant open chrome processes, or has opened them but the ports don't exist

@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Jan 2, 2025
@lmsalopek
Copy link

@emmabDF
A quick FYI
I was facing the same issue and downgrading my node.js to 18 solved the issue for me.
Those on our team using MacOs are not seeing the issue and it appears those with windows on VM are not seeing the issue - so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATE: Need response An issue that requires a response or attention from the team. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

3 participants