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
Currently, Cypress has support for Chrome-family browsers (including Electron and Chromium-based Microsoft Edge), WebKit (Safari's browser engine), and Firefox. Tests that require the chromeWebSecurity configuration option to be disabled may experience issues in non-Chromium based browsers.
It uses Sauce Labs (or another headless driver) to interact with browsers. Its API consists of commands that query for DOM elements, perform user actions, navigate around, etc. Cypress essentially replaces Capybara because it does all of these things and much more.
In your project's supports file:const addExtensionCommands = require('cypress-browser-extension-plugin/commands'); addExtensionCommands(Cypress); That's all you need to load a single extension now run cypress by hitting following command. Select the spec file, loadChromeExtension.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With