Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add the chrome binary to run e.g. Karma tests on headless chrome on a CI server

I like to run my karma unit tests on a headless chrome. Using karma-chrome-launcher and setting the browser to "ChromeHeadless" works on my machine. But on the CI server it fails with the message "No binary for ChromeHeadless browser on your platform." Installing chrome on the CI machine is not possible. Is there another way to load the chrome binaries? for example the google puppeteer module seems to load that when run. from the docs: "Puppeteer downloads and uses a specific version of Chromium". How can i achieve the same?

like image 229
user2520818 Avatar asked Aug 25 '17 12:08

user2520818


People also ask

How do I run Chrome in headless mode?

Which command starts the google chrome web browser in headless mode? As we have already seen, you just have to add the flag –headless when you launch the browser to be in headless mode. With CLI (Command Line Interface), just write: chrome \<br> – headless \ # Runs Chrome in headless mode.

What version of Chrome is headless browser?

Note: Headless mode has been available on Mac and Linux since Chrome 59. Windows support came in Chrome 60.

How do I run Chrome headless in Linux?

You can run Google Chrome in headless mode simply by setting the headless property of the chromeOptions object to True. Or, you can use the add_argument() method of the chromeOptions object to add the –headless command-line argument to run Google Chrome in headless mode using the Selenium Chrome web driver.


1 Answers

You can use Puppeteer (headless Chromium), follow these instructions.

like image 140
Oleksandr Fediashov Avatar answered Oct 20 '22 00:10

Oleksandr Fediashov