Cypress 5.0 - Unable to find installed browsers
Asked Answered
S

6

10

I have Cypress 5.0 installed and have all the browsers - Chrome, Edge and FF. When I run

> npx cypress open

Not able to see all the browsers on the top right corner. Only Electron is showing

I tried

> npx cypress open --browser chrome

I get the following error

Can't run because you've entered an invalid browser name.                         
                                                                                  
Browser: 'chrome' was not found on your system or is not supported by Cypress.    
                                                                                  
Cypress supports the following browsers:                                          
- chrome                                                                          
- chromium                                                                        
- edge                                                                            
- electron                                                                        
- firefox (Cypress support in beta)                                               
                                                                                  
You can also use a custom browser: https://on.cypress.io/customize-browsers       
                                                                                  
Available browsers found on your system are:                                      
- electron                                                                        
                                                                              

I also tried

> npx cypress open --browser C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

Cypress shows the error - We could not identify a known browser at the path you provided

One of my other machine, I am able to see all the browsers from get go.

Any help will be appreciated

Schaal answered 3/9, 2020 at 21:1 Comment(1)
Same issue when running in CI with docker imageChaisson
F
2

I have faced similar issue in my organization and Symlink helped me to handle that. In my scenario the chrome brower was not installed in default folder where cypress looks for Chrome.exe ('C:/Program Files (x86)/Google/Chrome/Application/chrome.exe','C:/Program Files/Google/Chrome/Application/chrome.exe')

When I tried below command with my installed chrome brower path:

 npx cypress open --browser "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

It fails with error that unable to find browser at "C:\Program". It seems its splitting the --browser path with SPACE and fails to indentify the chrome browser.

So I created a symlink at default folder where cypress looks for chrome browser by default.

C:\mklink /J "C:\Program Files\Google\Chrome\Application" "C:\Program Files \Google Chrome (Local)"

Post completion of the Symlink I can see new path "C:\Program Files\Google\Chrome\Application" takes me to chrome.exe. Now I can run the cypess open command without browser tag and should see the chrome browser added in browser dropdown.

npx cypress open

Note:

  1. Run the cmd as administrator
  2. Make sure the "C:\Program Files\Google\Chrome" folder exist prior running the symlink command
Foxy answered 2/11, 2021 at 17:34 Comment(1)
Symlink good idea. Powershell example New-Item -ItemType SymbolicLink -Path "C:\Program Files\Google\Chrome" -Target "C:\Users\<user>\AppData\Local\Google\Chrome"Washing
E
2

Ran into the exact same error message. It's because the docker image does not have any of those browsers installed on it.

I solved it by just installing chrome onto the image I was using with these commands

RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb

you could also potentially link your chrome app to your container using the docker volumes but I figured the windows version of chrome wouldn't play nice in the linux image.

Earing answered 13/4, 2022 at 0:20 Comment(0)
E
1

it was working for me on window by following steps-

  1. Clear all content as mentioned into - https://github.com/cypress-io/cypress/issues/2834#issuecomment-441956393
  2. Close Cypress APP and VS code both.
  3. Add following entry into "PATH" variable- C:\Windows\System32\wbem
  4. Uninstall and install chrome again.
  5. Open VS Code and open Cypress APP. you can see now Chrome.
Endless answered 16/9, 2022 at 6:33 Comment(0)
K
0

I was having the same issue with Jenkins and solved it just by adding C:\\Windows\\System32\\wbem to my PATH in the pipeline script (in the withEnv section).

Kawasaki answered 21/10, 2020 at 15:8 Comment(0)
M
0

I had same issue with Cypress 7.1.0. Cypress shows only Edge. I removed the app data described in here. After reinstalling the Google Chrome, Cypress show both of Chrome and Edge.

Myrmidon answered 18/4, 2021 at 1:34 Comment(0)
T
0

For me, Chrome was installed in my AppData. I moved the Chrome folder to Program Files, and it worked after that.

Tweeze answered 28/5, 2024 at 14:15 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.