Open mjbradford89 opened 6 years ago
I've been having similar issues on Windows 7. This fixed it for me: https://github.com/Codeception/CodeceptJS/issues/561#issuecomment-373666779
@shaunOclcl can you please elaborate a bit further? Where in the karma.config did you placed those two options?
Thanks!
@raveneyex I've defined a custom launcher based on ChromiumHeadless. The custom launcher allows flags to be passed to the Chrome (or Chromium) instance.
process.env.CHROMIUM_BIN = require('puppeteer').executablePath();
module.exports = function(config) {
config.set({
....*other karma config settings*....
browsers: ['HeadlessChromium'],
customLaunchers: {
HeadlessChromium: {
base: 'ChromiumHeadless',
flags: [
'--no-sandbox',
'--remote-debugging-port=9222',
'--enable-logging',
'--user-data-dir=./karma-chrome',
'--v=1',
'--disable-background-timer-throttling',
'--disable-renderer-backgrounding',
'--proxy-bypass-list=*',
'--proxy-server=\'direct://\''
]
}
}
});
};
@shaunOclcl thank you for the reply! I'm going to check how that stuff works out for me.
Peace!
To make this run successfully, Please follow the procedure
Method 1: Most of the issues will be fixed and we can run ChromeHeadless if we download chromium version(debian) in wsl and install
step 1: install necessary packages
sudo apt-get update
sudo apt-get install -y curl unzip xvfb libxi6 libgconf-2-4
step 2: install chromium
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
If still problem persists, please follow the method 2
method 2: To run a basic Selenium UI test on any environment we need a browser and a driver to control the browser. So we've to make Windows’s Chrome browser and the chromedriver accessible from WSL.
step 1: Link Chrome browser on Windows
sudo ln -sf '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe' /usr/bin/google-chrome
step 2: Link chromedriver on Windows
sudo ln -s /mnt/c/Users/username/node_modules/chromedriver/lib/chromedriver/chromedriver.exe /usr/bin/chromedriver
step 3: Change CHROME_BIN (environmental variable's default value)
export CHROME_BIN='/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
If still problem persists, please follow the method 3
Method 3: This will help run puppetteer on Ubuntu, so let's install necessary packages:
sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
browsers: ['Chrome'],
browsers: ['Chrome'],
does using Chrome instead of ChromeHeadless helped you?, It's much slower, isn't it?
To make this run successfully, Please follow the procedure
Method 1: Most of the issues will be fixed and we can run ChromeHeadless if we download chromium version(debian) in wsl and install
step 1: install necessary packages
sudo apt-get update
sudo apt-get install -y curl unzip xvfb libxi6 libgconf-2-4
step 2: install chromium
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
If still problem persists, please follow the method 2
method 2: To run a basic Selenium UI test on any environment we need a browser and a driver to control the browser. So we've to make Windows’s Chrome browser and the chromedriver accessible from WSL.
step 1: Link Chrome browser on Windows
sudo ln -sf '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe' /usr/bin/google-chrome
step 2: Link chromedriver on Windows
sudo ln -s /mnt/c/Users/username/node_modules/chromedriver/lib/chromedriver/chromedriver.exe /usr/bin/chromedriver
step 3: Change CHROME_BIN (environmental variable's default value)
export CHROME_BIN='/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
If still problem persists, please follow the method 3
Method 3: This will help run puppetteer on Ubuntu, so let's install necessary packages:
sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
for me it says, [INFO] [0518/130005.862638:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
I've done everything also provided different flags from issues but still couldn't launch chrome headless on Ubuntu 22.04
I'm having some trouble getting ChromeHeadless to start. The error message doesn't give much information:
Here is my karma config:
Any suggestions?
I'm on Ubuntu 16.04 and Chrome 62.