DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.81k stars 667 forks source link

Chrome's search engine prompt causes testcafe process to fail #8241

Closed maksnester closed 1 month ago

maksnester commented 1 month ago

What is your Scenario?

See this article explaining the prompt https://www.ghacks.net/2023/12/09/google-chrome-to-display-choose-your-search-engine-prompt/

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

Error: WebSocket connection closed
    at /Users/me/projects/org-accountsettings-client/node_modules/chrome-remote-interface/lib/chrome.js:94:35
    at Chrome._handleConnectionClose (/Users/me/projects/org-accountsettings-client/node_modules/chrome-remote-interface/lib/chrome.js:256:13)
    at WebSocket.<anonymous> (/Users/me/projects/org-accountsettings-client/node_modules/chrome-remote-interface/lib/chrome.js:243:22)
    at WebSocket.emit (node:events:517:28)
    at WebSocket.emit (node:domain:489:12)
    at WebSocket.emitClose (/Users/me/projects/org-accountsettings-client/node_modules/chrome-remote-interface/node_modules/ws/lib/websocket.js:246:10)
    at Socket.socketOnClose (/Users/me/projects/org-accountsettings-client/node_modules/chrome-remote-interface/node_modules/ws/lib/websocket.js:1148:15)
    at Socket.emit (node:events:517:28)
    at Socket.emit (node:domain:489:12)
    at TCP.<anonymous> (node:net:350:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
    at BrowserConnection._runBrowse

What is the Current behavior?

When I run testcafe I see chrome opens briefly with that prompt and then testcafe fails and kills the browser before I can select anything there to make that prompt to go away.

What is the Expected behavior?

Let the browser to hang a little or suggest some chrome flag that can forbid this prompt if there is any.

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

yeah right

What is your TestCafe test code?

doesn't matter here

Your complete configuration file

"browsers": ["chrome --window-size=1280,800 --no-sandbox --disable-dev-shm-usage"], disableNativeAutomation": false

The last one is important as it happens only in that case. When it is disabled, I have time to select the search engine in prompt and test continues. But when I run tests the next time I see the prompt again, so my selection is not saved for some reason.

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

I don't know the exact steps to cause chrome to show this dummy modal window.

TestCafe version

3.6.2

Node.js version

v18.18.0

Command-line arguments

irrelevant, I use createTestCafe and didn't change any args

Browser name(s) and version(s)

Version 127.0.6533.73 (Official Build) (arm64)

Platform(s) and version(s)

macOS 14.5 (23F79)

Other

My settings in chrome are not saved, even if I manually open chrome/flags and turn off that search engine dialog, on the next run I see it again.

vasilyevi commented 1 month ago

same to me total blocker workaround: --disable-search-engine-choice-screen

PavelMor25 commented 1 month ago

Hello @maksnester,

Thank you for your report.

Please refer to the #8240 issue. I'll close this issue as a duplicate.