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

Browser: 'firefox' was not found on your system or is not supported by Cypress. #15258

Closed
niru005 opened this issue Feb 27, 2021 · 15 comments
Closed
Labels
stale no activity on this issue for a long period

Comments

@niru005
Copy link

niru005 commented Feb 27, 2021

I am trying to run the test on firefox in headless mode using below command, But cypress in not able to find firefox browser.

npx cypress run --browser firefox

Current behavior

Can't run because you've entered an invalid browser name.

Browser: 'firefox' was not found on your system or is not supported by Cypress.

Cypress supports the following browsers:

  • chrome
  • chromium
  • edge
  • electron
  • firefox

You can also use a custom browser: https://on.cypress.io/customize-browsers

Available browsers found on your system are:

  • chrome
  • electron

Desired behavior

Cypress should able to detect firefox browser & test should run on firefox.

Cypress version - npx cypress verify

✔ Verified Cypress! /var/lib/jenkins/.cache/Cypress/6.5.0/Cypress

Firefox version - firefox --version

Mozilla Firefox 84.0.2

@jennifer-shehane
Copy link
Member

Please see our troubleshooting guide on Launching Browsers

Could you run Cypress in debug mode specifically logging cypress:launcher logs and run cypress info and print the entire set of logs here?

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Feb 27, 2021
@niru005
Copy link
Author

niru005 commented Mar 1, 2021

Log -> DEBUG=cypress:launcher npx cypress run --browser firefox

  cypress:launcher detecting if the following browsers are present [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', versionRegex: /Google Chrome (\S+)/m, binary: [ 'google-chrome', 'chrome', 'google-chrome-stable' ] }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', versionRegex: /Chromium (\S+)/m, binary: [ 'chromium-browser', 'chromium' ] }, { name: 'chrome', family: 'chromium', channel: 'canary', displayName: 'Canary', versionRegex: /Google Chrome Canary (\S+)/m, binary: 'google-chrome-canary' }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m, binary: 'firefox' }, { name: 'firefox', family: 'firefox', channel: 'dev', displayName: 'Firefox Developer Edition', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m, binary: [ 'firefox-developer-edition', 'firefox' ] }, { name: 'firefox', family: 'firefox', channel: 'nightly', displayName: 'Firefox Nightly', versionRegex: /^Mozilla Firefox (\S+a\S*)$/m, binary: [ 'firefox-nightly', 'firefox-trunk' ] }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', versionRegex: /Microsoft Edge (\S+)/m, binary: [ 'edge', 'microsoft-edge' ] }, { name: 'edge', family: 'chromium', channel: 'canary', displayName: 'Edge Canary', versionRegex: /Microsoft Edge Canary (\S+)/m, binary: 'edge-canary' }, { name: 'edge', family: 'chromium', channel: 'beta', displayName: 'Edge Beta', versionRegex: /Microsoft Edge Beta (\S+)/m, binary: 'edge-beta' }, { name: 'edge', family: 'chromium', channel: 'dev', displayName: 'Edge Dev', versionRegex: /Microsoft Edge Dev (\S+)/m, binary: [ 'edge-dev', 'microsoft-edge-dev' ] } ] +0ms
  cypress:launcher checking one browser chrome +6ms
  cypress:launcher looking up chrome on linux platform +0ms
  cypress:launcher finding version string using command "google-chrome --version" +1ms
  cypress:launcher checking one browser chrome +11ms
  cypress:launcher looking up chrome on linux platform +0ms
  cypress:launcher finding version string using command "chrome --version" +0ms
  cypress:launcher checking one browser chrome +9ms
  cypress:launcher looking up chrome on linux platform +0ms
  cypress:launcher finding version string using command "google-chrome-stable --version" +0ms
  cypress:launcher Received error detecting browser binary: "chrome" with error: spawn chrome ENOENT +10ms
  cypress:launcher browser chrome not installed +1ms
  cypress:launcher stdout: "Google Chrome 88.0.4324.182" +17ms
  cypress:launcher setting major version for {"name":"chrome","family":"chromium","channel":"stable","displayName":"Chrome","version":"88.0.4324.182","path":"google-chrome"} +1ms
  cypress:launcher browser chrome version 88.0.4324.182 major version 88 +0ms
  cypress:launcher stdout: "Google Chrome 88.0.4324.182" +19ms
  cypress:launcher setting major version for {"name":"chrome","family":"chromium","channel":"stable","displayName":"Chrome","version":"88.0.4324.182","path":"google-chrome-stable"} +0ms
  cypress:launcher browser chrome version 88.0.4324.182 major version 88 +0ms
  cypress:launcher checking one browser chromium +0ms
  cypress:launcher looking up chromium on linux platform +0ms
  cypress:launcher finding version string using command "chromium-browser --version" +0ms
  cypress:launcher checking one browser chromium +9ms
  cypress:launcher looking up chromium on linux platform +0ms
  cypress:launcher finding version string using command "chromium --version" +0ms
  cypress:launcher Received error detecting browser binary: "chromium-browser" with error: spawn chromium-browser ENOENT +9ms
  cypress:launcher Received error detecting browser binary: "chromium" with error: spawn chromium ENOENT +1ms
  cypress:launcher browser chromium not installed +0ms
  cypress:launcher browser chromium not installed +0ms
  cypress:launcher checking one browser chrome +0ms
  cypress:launcher looking up chrome on linux platform +0ms
  cypress:launcher finding version string using command "google-chrome-canary --version" +0ms
  cypress:launcher Received error detecting browser binary: "google-chrome-canary" with error: spawn google-chrome-canary ENOENT +9ms
  cypress:launcher browser chrome not installed +0ms
  cypress:launcher checking one browser firefox +0ms
  cypress:launcher looking up firefox on linux platform +0ms
  cypress:launcher finding version string using command "firefox --version" +0ms
  cypress:launcher stdout: "" +34ms
  cypress:launcher Could not extract version from stdout using regex: { stdout: '', versionRegex: /^Mozilla Firefox ([^\sab]+)$/m } +0ms
  cypress:launcher Received error detecting browser binary: "firefox" with error: Browser not installed: firefox +1ms
  cypress:launcher browser firefox not installed +0ms
  cypress:launcher checking one browser firefox +0ms
  cypress:launcher looking up firefox on linux platform +0ms
  cypress:launcher finding version string using command "firefox-developer-edition --version" +0ms
  cypress:launcher checking one browser firefox +9ms
  cypress:launcher looking up firefox on linux platform +0ms
  cypress:launcher finding version string using command "firefox --version" +0ms
  cypress:launcher Received error detecting browser binary: "firefox-developer-edition" with error: spawn firefox-developer-edition ENOENT +9ms
  cypress:launcher browser firefox not installed +0ms
  cypress:launcher stdout: "" +24ms
  cypress:launcher Could not extract version from stdout using regex: { stdout: '', versionRegex: /^Mozilla Firefox (\S+b\S*)$/m } +0ms
  cypress:launcher Received error detecting browser binary: "firefox" with error: Browser not installed: firefox +1ms
  cypress:launcher browser firefox not installed +0ms
  cypress:launcher checking one browser firefox +0ms
  cypress:launcher looking up firefox on linux platform +0ms
  cypress:launcher finding version string using command "firefox-nightly --version" +0ms
  cypress:launcher checking one browser firefox +9ms
  cypress:launcher looking up firefox on linux platform +0ms
  cypress:launcher finding version string using command "firefox-trunk --version" +0ms
  cypress:launcher Received error detecting browser binary: "firefox-nightly" with error: spawn firefox-nightly ENOENT +9ms
  cypress:launcher Received error detecting browser binary: "firefox-trunk" with error: spawn firefox-trunk ENOENT +0ms
  cypress:launcher browser firefox not installed +1ms
  cypress:launcher browser firefox not installed +0ms
  cypress:launcher checking one browser edge +0ms
  cypress:launcher looking up edge on linux platform +0ms
  cypress:launcher finding version string using command "edge --version" +0ms
  cypress:launcher checking one browser edge +7ms
  cypress:launcher looking up edge on linux platform +0ms
  cypress:launcher finding version string using command "microsoft-edge --version" +0ms
  cypress:launcher Received error detecting browser binary: "edge" with error: spawn edge ENOENT +7ms
  cypress:launcher Received error detecting browser binary: "microsoft-edge" with error: spawn microsoft-edge ENOENT +0ms
  cypress:launcher browser edge not installed +1ms
  cypress:launcher browser edge not installed +0ms
  cypress:launcher checking one browser edge +0ms
  cypress:launcher looking up edge on linux platform +0ms
  cypress:launcher finding version string using command "edge-canary --version" +0ms
  cypress:launcher Received error detecting browser binary: "edge-canary" with error: spawn edge-canary ENOENT +7ms
  cypress:launcher browser edge not installed +0ms
  cypress:launcher checking one browser edge +0ms
  cypress:launcher looking up edge on linux platform +0ms
  cypress:launcher finding version string using command "edge-beta --version" +0ms
  cypress:launcher Received error detecting browser binary: "edge-beta" with error: spawn edge-beta ENOENT +8ms
  cypress:launcher browser edge not installed +0ms
  cypress:launcher checking one browser edge +0ms
  cypress:launcher looking up edge on linux platform +0ms
  cypress:launcher finding version string using command "edge-dev --version" +0ms
  cypress:launcher checking one browser edge +7ms
  cypress:launcher looking up edge on linux platform +0ms
  cypress:launcher finding version string using command "microsoft-edge-dev --version" +0ms
  cypress:launcher Received error detecting browser binary: "edge-dev" with error: spawn edge-dev ENOENT +7ms
  cypress:launcher Received error detecting browser binary: "microsoft-edge-dev" with error: spawn microsoft-edge-dev ENOENT +0ms
  cypress:launcher browser edge not installed +1ms
  cypress:launcher browser edge not installed +0ms
Can't run because you've entered an invalid browser name.

Browser: 'firefox' was not found on your system or is not supported by Cypress.

Cypress supports the following browsers:
- chrome
- chromium
- edge
- electron
- firefox

You can also use a custom browser: https://on.cypress.io/customize-browsers

Available browsers found on your system are:
- chrome
- electron

@niru005
Copy link
Author

niru005 commented Mar 1, 2021

Log for -> npx cypress info

Displaying Cypress info...

Detected 1 browser installed:

  1. Chrome
  • Name: chrome
  • Channel: stable
  • Version: 88.0.4324.182
  • Executable: google-chrome

Note: to run these browsers, pass : to the '--browser' field

Examples:

  • cypress run --browser chrome

Cypress Version: 6.5.0
System Platform: linux (Ubuntu - 16.04)

@niru005
Copy link
Author

niru005 commented Mar 1, 2021

It is not detecting firefox, where firefox is installed in my system

firefox --version
Mozilla Firefox 85.0.1

@jennifer-shehane
Copy link
Member

@niru005 Do you know the location where Firefox is downloaded? Did you try to pass the path to the downloaded location as shown in https://on.cypress.io/troubleshooting#Launching-browsers?

@niru005
Copy link
Author

niru005 commented Mar 2, 2021

I have tried to pass the path of firefox as well but it is not working.

npx cypress run --browser /usr/bin/firefox
We could not identify a known browser at the path you provided: /usr/bin/firefox

The output from the command we ran was:

Unable to find browser with path /usr/bin/firefox

@Quentame
Copy link

Have you tried an absolute path ?

This

npx cypress run --browser "C:/dev/softs/Mozilla Firefox/firefox.exe"

worked for me.

@jennifer-shehane
Copy link
Member

@niru005 Are you using Docker to run your tests? Possible duplicate of #8611

@JulZimmermann
Copy link

I had the same problem with an Ubuntu 22.04-based docker image. Ubuntu 22.04 will install a snap version of firefox by default, which will not run in docker.

I had to install the "normal" non-snap version of firefox: https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 17, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
@hckhanh
Copy link

hckhanh commented Jul 15, 2023

I get the same issue, for my case:

  • Chrome
  • Edge
  • Electron
  • Webkit

Only Firefox is missing

@JanAbe
Copy link

JanAbe commented Apr 4, 2024

I am not using docker and have the same problem.

When I run npx cypress run --browser firefox or npx cypress run --browser /usr/bin/firefox I get the notification that I have entered an invalid browser name and that cypress is unable to find a browser with path /usr/bin/firefox respectively.

(I am on ubuntu 22.04)

@blagerweij
Copy link

We also ran into the same issue, and used the same workaround: use the --browser parameter pointing to the real binary, not the snap wrapper. Or alternatively, use the native installer isntead of snap.

npx cypress run --browser /snap/firefox/current/usr/lib/firefox/firefox

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Apr 26, 2024
@yabab
Copy link

yabab commented May 9, 2024

We ended up building an image from cypress/base and adding Firefox manually, here's a Dockerfile for that:

FROM cypress/base:18.16.1  

ARG FIREFOX_VERSION=125.0.3

USER root:root
RUN apt-get update && apt-get install -y bzip2 ca-certificates
RUN wget -O firefox.tar.bz2 "https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2"  

RUN tar -xvf firefox.tar.bz2 -C /opt
RUN rm firefox.tar.bz2 
RUN ln -s /opt/firefox/firefox /usr/bin/firefox

USER node:node

You could also use a cypress/browser image and simply force replace Firefox, like in this Dockerfile:

FROM cypress/browsers:node-18.16.1-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1

ARG FIREFOX_VERSION=125.0.3

USER root:root
RUN apt-get update && apt-get install -y bzip2
RUN wget -O firefox.tar.bz2 "https://ftp.mozilla.org/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2"  

RUN tar -xvf firefox.tar.bz2 -C /opt
RUN rm firefox.tar.bz2 
RUN ln -sf /opt/firefox/firefox /usr/bin/firefox

USER node:node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

9 participants