Cypress: Cypress.io does not launch chrome on Windows 10: 'Whoops, we can't run your tests'

Created on 31 Mar 2020  路  15Comments  路  Source: cypress-io/cypress

Current behavior:

I updated cypress from 4.2.0 to 4.3.0 and now I am not able to run my cypress tests in chrome. I get the following error message

Whoops, we can't run your tests.
This browser was not launched through Cypress. Tests cannot run.

I am able to run my tests in firefox, edge and electron. But not Chrome and Canary.

I tried to delete the app data so cypress could rebuild them but it did not rebuild.


image

Desired behavior:

I want to run my tests also in chrome.

Test code to reproduce

its not necessary which code i use. its the same with example.spec


Versions

i am using windows 10 enterprise version 1903,
cypress.io 4.3.0,
Chrome Version 80.0.3987.149 (64bit)
Canary Version 82.0.4081.0 (64bit)

windows blocking needs information 馃槼 whoops we can't run your tests

Most helpful comment

Hi :jennifer-shehane
I am facing the same issue. This is the first time I am trying Cypress and not able to proceed further due to the issue. I am using Chrome 84 version and latest version of Cypress on Windows 10 The example tests run alright on the electron browser but not on chrome. Get the same "Whoops, we can't run your tests. The browser was not launched through Cyrpess.Tests cannot run" error.
There is also no cypress extension in the test window. Have tried all the steps mentioned like clearing the app data etc but no luck.
image

All 15 comments

Yes, generally deleting App Data does help in these cases.

Electron is using 80.0.3987.158 - which is even a bit above your version, so I don't think it's related to the Chrome version per se.

  • Does downgrading to 4.2.0 fix your issue?
  • Can you ensure your company did not recently block Chrome extensions - your company will need to whitelist our extension if so. Or maybe some other corporate setting behind Chrome has changed?

Yes, generally deleting App Data does help in these cases.

Electron is using 80.0.3987.158 - which is even a bit above your version, so I don't think it's related to the Chrome version per se.

  • Does downgrading to 4.2.0 fix your issue?

no it doesnt work for me

  • Can you ensure your company did not recently block Chrome extensions - your company will need to whitelist our extension if so. Or maybe some other corporate setting behind Chrome has changed?

I asked my company to whitelist that extension. but it still doesnt work.

@jennifer-shehane as you can see, the cypress icon was not visible in the browser before @utd20's company whitelisted the extension. Therefore whitelisting could not be the problem with my issue (#7947).

Yeah, I'm not sure why this is happening for a select number of people on Windows.

  • Does the browser launch outside of Chrome for everyone else? (Firefox, Electron, Edge)
  • Are you all behind a corporate proxy? With proxy configured?
  • Could you run Cypress in debug mode mode and print the entire set of logs here?

Yeah, I'm not sure why this is happening for a select number of people on Windows.

  • Does the browser launch outside of Chrome for everyone else? (Firefox, Electron, Edge)
  • Are you all behind a corporate proxy? With proxy configured?
  • Could you run Cypress in debug mode mode and print the entire set of logs here?

I cannot run cypress in debug mode.
but i can reach other webpages besides localhost.
And i can use cypress with every other browser.

hmm. i tried to use cypress with chrome today after 3 month. it opens my localhost website but does not do the tests. also i can not see the "test steps" at the left side of my browser

@jennifer-shehane
Cypress does not offer firefox nor edge. But the debuglog says 'whitelisted:false' when running with Chrome:

cypress:server:util:socket_whitelist is incoming request whitelisted? { isWhitelisted: false, reqUrl: '/__socket.io/?EIO=3&transport=websocket', remotePort: 52658, remoteAddress: '127.0.0.1' } +5s

So I guess the extension is not whitelisted despite the fact, that the extension icon shows up in Chrome.

Yeah, that log does seem to indicate that something is not going through with the proxy config.

Certain group policies (GPOs) on Windows may prevent Cypress from working as intended, which can cause tests to break.

Can you read here for more info and workarounds: https://on.cypress.io/error-messages#Cypress-detected-policy-settings-on-your-computer-that-may-cause-issues and see if any of those resolve your issues?

Tried suggestions given on the linked page. First tried to delete the registry keys, but couldn't find any of the mentioned ones in my registry. Then tried it with chromium, but Cypress refused to launch it with the error

Error: We could not identify a known browser at the path you provided: C:\Users\********\AppData\Local\Chromium\Application\chrome.exe

The output from the command we ran was:
at get (C:Users**AppDataLocalCypressCache4.10.0Cypressresourcesapppackagesserverliberrors.js:946:15)
at Object.throwErr [as throw] (C:Users*
*AppDataLocalCypressCache4.10.0Cypressresourcesapppackagesserverliberrors.js:964:9)
at C:Users*
**AppDataLocalCypressCache4.10.0Cypressresourcesapppackagesserverlibbrowsersindex.js:119:28

I used following command:

cypress open --browser C:Users***AppDataLocalChromiumApplicationchrome.exe

chromium.exe is working if called directly from the command line.

Hello @jennifer-shehane
Even i am encountering this issue
I am new to cypress and able to execute the example tests ok in Cypress
Its only when i try Launching the tests in Chrome, i am encountering the issue

Hi :jennifer-shehane
I am facing the same issue. This is the first time I am trying Cypress and not able to proceed further due to the issue. I am using Chrome 84 version and latest version of Cypress on Windows 10 The example tests run alright on the electron browser but not on chrome. Get the same "Whoops, we can't run your tests. The browser was not launched through Cyrpess.Tests cannot run" error.
There is also no cypress extension in the test window. Have tried all the steps mentioned like clearing the app data etc but no luck.
image

Hello @jennifer-shehane ,

I am currently trying to use Cypress as a test-runner at work but I am facing the same issue as my peers.
I am either getting a "Whoops, we can't run your tests." error if I do not specify a baseUrl or just loading the baseUrl without the cypress test-runner...
The tests do run fine on electron though. That makes me think that it is not proxy-related.

I tried it at home and it seems that everything works fine there.

When checking the cypress extension, I din't find anything that was specifying that the extension was blocked.
Tried to clean the cache but it didn't help.

Desired behavior:

I want to run my tests also in chrome.

Test code to reproduce

its not necessary which code i use. its the same with example.spec

Versions

OS: Windows 10 Enterprise
Cypress.io: 5.2.0
Chrome: 85.0.4183.121 (Build officiel) (64 bits)

Hello @jennifer-shehane

I have the same issue. On the work system, the test runner will not open and run tests in Chrome. It runs fine in Electron and Edge.

Is the test runner trying to call api.cypress.io and being blocked?

Here is some logs ----

  cypress:server:project get project status for client id undefined at path C:\work\dev\vci-dashboard-app\dashboard-app +10s
  cypress:server:project no project id +1ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.19648896887533596, data: { id: undefined, path: 'C:\
\work\\dev\\vci-dashboard-app\\dashboard-app', state: 'VALID' } }, originalData: { id: 0.19648896887533596, data: { id: undefined, path:
'C:\\work\\dev\\vci-dashboard-app\\dashboard-app', state: 'VALID' } } } +1ms
  cypress:server:events got request for event: ping:api:server, undefined +5s
  cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 } +22s
  cypress:network:connect got addresses { hostname: 'api.cypress.io', port: 443, addresses: [ { address: '172.67.69.12', family: 4 }, { a
ddress: '104.26.6.176', family: 4 }, { address: '104.26.7.176', family: 4 } ] } +34ms
  cypress:server:events sending ipc data { type: 'ping:api:server', data: { id: 0.4604542597099468, data: { address: '172.67.69.12', fami
ly: 4 } }, originalData: { id: 0.4604542597099468, data: { address: '172.67.69.12', family: 4 } } } +60ms
  cypress:server:events got request for event: get:project:status, { id: undefined, path: 'C:\\work\\dev\\vci-dashboard-app\\dashboard-ap
p' } +5s
  cypress:server:project get project status for client id undefined at path C:\work\dev\vci-dashboard-app\dashboard-app +10s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.9349231314744331, data: { id: undefined, path: 'C:\\
work\\dev\\vci-dashboard-app\\dashboard-app', state: 'VALID' } }, originalData: { id: 0.9349231314744331, data: { id: undefined, path: 'C
:\\work\\dev\\vci-dashboard-app\\dashboard-app', state: 'VALID' } } } +2ms
  cyp

OS: Windows 10 Enterprise
Cypress.io: 5.2.0
Version 85.0.4183.102 (Official Build) (32-bit)

Hey, @kevin-clark2, I found a solution.
There is a chrome parameter that is managed by the active-directory (Registry-key : ProxyMode) that does interfer with Cypress settings or something. #1253

When I remove it from the register, cypress launch without a problem, you might want to try this out ?

Thanks a bunch, @KuroiRaven and @jennifer-shehane. I encountered this issue for the first time today, and it turns out that the ProxyMode registry setting was causing my issue as well. Chrome is managed by my organization through Group Policy, and I assume this ProxyMode setting is being set as part of the managed settings.

Handy docs link for more details: https://docs.cypress.io/guides/references/error-messages.html#Cypress-detected-policy-settings-on-your-computer-that-may-cause-issues

Was this page helpful?
0 / 5 - 0 ratings