Robot framework tests are not running in github actions

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.)”

Dependencies in github actions:

          sudo apt-get update
          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
          sudo dpkg -i google-chrome-stable_current_amd64.deb
          sudo apt install -f
          google-chrome --version
          wget -N -P ~/
          unzip ~/ -d ~/
          rm ~/
          echo $PATH
          sudo mv -f ~/chromedriver /usr/local/bin
          sudo chmod +x /usr/local/bin/chromedriver
          echo $PATH

Parent setup:

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}

Hi @Tejaswini,

If I remember correctly github actions, just like docker containers don’t have a display server by default, but chrome needs one even when running headless.

I usually just use XVFB, but depending on what you need to do you might need a window manager as well, if are only useing BrowserLibrary or SeleniumLibrary then there is no need for a window manager, just running XVFB and setting up the $DISPLAY environment variable for your logged in user should be enough.

FYI this is the a snippet from one of my github actions for a gui app, so I needed a window manager (I used fluxbox) but this might help you get started (I ran xvfb on display 13, only because 13 is my lucky number, you can use any display number you like), obviously you’ll need to ensure xvfb and any window manager you want are installed:

      - name: "Ubuntu Xvfb"
        if: ${{ matrix.platform == 'ubuntu-latest' }}
        run: |
          export DISPLAY=:13.0
          Xvfb :13 -screen 0 1920x1080x24 > /dev/null 2>&1 &
          # xauth with complain unless ~/.Xauthority exists
          touch ~/.Xauthority
          # To view a listing of the .Xauthority file, enter the following 
          xauth list
          # fluxbox 
          fluxbox &

Hope this helps,