Im trying to run a very simple robot framework test of launching a browser from github actions. I have installed chrome and chrome browser and gave necessary permissions. But tests are failing with error “WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn’t exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)”
Package in github actions yaml file:
sudo apt-get update
pip install webdrivermanager
sudo webdrivermanager firefox chrome --linkpath /usr/bin
sudo chmod +x /usr/bin/chromedriver
sudo apt -y --force-yes install fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdrm2 libgbm1 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 xdg-utils
sudo apt -y --force-yes install wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt install -f
Login keyword file to launch browser:
Launch URL
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument --no-sandbox
Call Method ${chrome_options} add_argument --disable-extensions
Call Method ${chrome_options} add_argument --headless
Call Method ${chrome_options} add_argument --disable-gpu
Create Webdriver Chrome chrome_options=${chrome_options}
Go To ${URL}