-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Browser not launched through Cypress problem #1239
Comments
This is strange. This usually means that the Chrome browser could not connect to the Cypress Chrome extension that we run within the launched browser. I've only seen this happen after manually removing the extension from the profile. If you can get this to happen again, try running this: |
Thank you for your prompt reply. Here are the logs. |
So, the logs look pretty normal. 😞 Couple questions/comments.
|
I have been repro'ing this consistently. Almost every time cypress runs it has to open and close chrome a couple of times before it works. Sometimes it doesn't work though. I can confirm that the cypress extension is loading properly, I see the cypress extension logo and it responds when I click on it with "Cypress is automating the browser". |
The Cypress extension little logo didn't appear on the Chrome browser. I executed the steps you mentioned to clear the App data, and now it's working fine. Thank a bunch! |
This solution is working only if you want to run your test exactly from Cypress api. Example: const cypress = require('cypress')
cypress.run({
browser: 'chrome',
spec: 'C:/Users/Zbyszek/Automats/online/cypress/integration/1ARegisterDashboardCustomer.js'
})
.then((results) => {
console.log(results)
})
.catch((err) => {
console.error(err)
}) |
I can consistently reproduce this issue by placing spec files one directory deeper than the integration folder. If I copy the example_spec.js file into a folder called "examples", I'll get the same error zbigniewkalinowski showed above. We're using Cypress version 2.1.0 on OSX High Sierra. |
If you don't see the Cypress extension when it spawns Chrome - then that's why you're seeing this message. The only way that happens is if you remove the extension manually or muck around in the Cypress profile, or modify the launch args of Chrome (inside Cypress) to forcibly remove this. |
For us to reproduce this we need step by step instructions along with DEBUG logs.
Like:
Additionally we need information about your environment. Are you running Cypress at work? At home? Do you have any system network settings that you've configured that aren't default? Are you running proxies at work? |
@zbigniewkalinowski I can see clear as day that your Chrome browser isn't running the Cypress extension. That's why you're getting this error message. |
Hi, @brian-mann : How can I give you logs on windows 10-64 bits? By deleting all the files and folders in View App Data, I always got "Whoops, we can't run yours tests" |
If you're deleting everything in App Data that's exactly why it's not working. After you delete the App Data you need to close + reopen Cypress and it should recreate them. The extension is literally in App Data, so by deleting that you are nuking the extension, and thus you get the message. For Windows 10, you can just copy all the logs, or if you're using powershell redirect stdout / stderr to a file so you don't have to copy and paste it all. |
Hi, @brian-mann : Thanks for your explanations. I followed them. However, it doesn't work... I got the same result. My steps were:
Which prerequisites are missing? |
I was experiencing the same behavior. Deleting the Cypress folder in the ~/Library/Application Support directory solved my problem. |
I am sorry but I use windows 10 - 64 bits and I don't find this path even if I display hidden folders... |
Hi, I would like to giveyou some additional information about my setup.
I use a proxy and the download of Cypress is always stopped. I founded another solution by downloading directly the Regards, |
More info: OS: Windows 7 I did a clean install of Cypress:
When I open Cypress, this is the log's output:
Notice the 500 errors. The Cypress app opens fine and when I click on the example test (example_spec.js), it opens the Google Chrome 65 browser, but nothing is showing (I see a white screen). The Cypress extension icon is not visible. If I enable the extension (it was disabled), and run the test again, I get again a white screen and now with the extension icon visible. If I run the command using ./node_modules/.bin/cypress instead of npx, I get exactly the same error. I tested this also without VPN, without the Windows defender and Windows firewall enabled, without an active virusscanner (read: I disabled everything). Still I get this error. Some debug logs:
|
Thanks @jennifer-shehane: Your solution worked for me. The reason I ended up with this issue was because of stopping a running test--> |
I have the same issue. I am using macOSX High Sierra version 10.13.5, chrome 67, Cypress 3.0.1. it very repeatable. After reading the comments above, I tried electron 59 and canary 69, both works. however, as soon as I change it to chrome 67, It would not work, meaning, it would display the error: "Whoops, we can't run your tests. This browser was not launched through Cypress. Tests cannot run." DEBUG=cypress:* cypress open did not show anything that point to an issue. |
I have this same issue as @PMK. I am on a Mac, when I run a test I get:
and a white screen and with the extension icon visible. I have tried deleting the app data dir as well as deleting ~/Library/Application\ Support/Cypress/ |
so I did a little digging through cypress github issues and through interwebs and I found a solution that fixed my problem. the problem with this seemed to be with reaching any URL within browser, while browser itself had no problem opening. I stumbled upon this and this issue and it seemed that some mess with localhost mapping was the core of the problem. there is an Anyway, since this file was empty, I basically looked what should be the defaults and copied them. Something like this:
(you probably don’t need to copy the comments) as I found out in those linked issues, Cypress apparently relies on this (probably the reason for throwing those Anyway, this worked for me and after two days of banging my head on the wall, I’m back writing my tests on a new mac 😄 |
@filiphric had the same issue, and adding |
Browser not launching through Cypress. Seems to be related to corporate policy not allowing unpacked plugins, only whitelisted. Could it be caused by the corporate policy? Is there a workaround, maybe adding the Cypress Extension ID to the corporate whitelist? Is there an ID that doesn´t change? |
We could generate a keypair and set the Workaround 1: Using Electron instead of Chrome to run your tests can bypass this group policy. Workaround 2: If you have Local Administrator access to your computer, you may be able to delete the registry keys that are blocking installing extensions in Chrome:
There is a related issue documenting efforts to bypass system policy settings within Cypress itself: #1253 |
Thank you for the great product. The static extension ID would be awesome! Seems like a simple/quick solution too. Does it help if I open an issue, or an branch+merge request? Workaround 1: Great! Tests are running in Electron, Page loading times are ok, but cy.visit is very slow to complete. Total time to run all 103 example tests is 385.65secs... Workaround 2: Corporate policy doesn´t allow me to be a Local Administrator. :-( |
Workaround 2 works for me. Thanks! |
The code for this is done in cypress-io/cypress#3674, but has yet to be released. |
Released in |
I've spent the day with a colleague experiencing this and none of the proposed solutions have helped. Our test suite runs fine on everyone else's machine except his. We've wiped app data, node modules, uninstalled browsers, cypress, etc. We have full admin access to our machines (Macs). The one thing that sticks out to me is how the URL string renders in the browser. See attached image. What else can I provide that may be useful for debugging? |
@ericdfields That shouldn't be happening, can you supply the debug logs you get when you launch Cypress using the debug environment variables?
|
Believe it or not, we reformatted the system and set things up as usual and it's working fine. :-/ I don't have a full copy of logs, but they looked similar to my working ones. |
Error launching browser ERR_CONNECTION_ABORTED (-103) loading 'http://localhost:61993/__/#/tests/integration\examples\SimpleProposalWorkflow.js' Stack trace Why i am getting this error ? last two days it was running fine and today when i trigger one test case through Cypress Test Runner. |
just sharing my experience - when I test with older version of chrome, all good for couple hours. but all of a sudden - I have the same error of
then the solution is - actually chrome updated itself and it seems to be the cause of this problem (I have also deleted "app data" in the cypress app as well)!! so when I re-install older version of chrome, then it all works again! FYI - if you want to disable auto update for chrome, this one works for me |
yet another solution here. In my case stuff was working fine in chrome but for some reason cypress could not find the URLs. Also a brand new Mac (coming from linux) and was setting up a docker project with WP Multisite and subdomains. My sites looked like http://site1.localhost and http://site2.localhost and so on. Fix: I had to add these entries to the /etc/hosts file:
I guess Chrome has some kind of internal DNS cache that got migrated with my synced browser settings, causing stuff to also work without these hosts entries. (they were present in my Linux machine) |
In case this helps anyone else, I wanted to share that our experience is entirely self inflicted. Developers are getting this error because operations has recently locked down chrome to the point that the cypress extension apparently won't install. |
I had the same problem in a MacOS enterprise environment because my company manages browser extensions. If this is the case, when you visit the extension management page at |
Current behavior:
When running any test using Chrome, the browser opens and shows the following message: This browser was not launched through Cypress. Tests cannot run., and a Run Chrome 64 button appears as well. Clicking the button launches the same browser again with the same message.
Desired behavior:
The test should be executed properly when running them on Chrome.
How to reproduce:
cypress open
Notice that the tests don't get executed
Test code:
Not relevant to the scenario. Same behaviour happen when running cypress examples.
Additional Info (images, stack traces, etc)
At the moment, in order to workaround this issue, I close the browser, run the test using Electron, the close it down and run again using Chrome. This way the test runs properly.
This happens when starting a new instance of cypress. After having it fixed through the workaround, the tests run properly regardless of if we close the browser or not.
I uninstalled Chrome and deleted all profile information, but the issue kept happening.
Note this issue is only happening on one machine. Any help to investigate would be appreciated.
The text was updated successfully, but these errors were encountered: