ubuntuselenium-webdriverpiprobotframework

robotframework can start but not interact with Chromium in Kubuntu 24.04


I am trying to use robotframework to drive Chromium in Kubuntu 24.04. I can get it to open the browser, but not to interact with it in any way past that point.

I am setting up my development environment as below:

python -m venv autolab
source autolab/bin/activate
pip install robotframework robotframework-seleniumlibrary

Chromium is installed as an Ubuntu snap.

After that I try the following test cases:

*** Settings ***
Documentation     Open Chromium on a given URL.
Library           SeleniumLibrary

*** Test Cases ***
interact with browser
  open browser  https://robotframework.org  Chrome
  location should be  https://robotframework.org
*** Settings ***
Documentation     Use ChromeDriver to open Chromium on a given URL.
Library           SeleniumLibrary

*** Test Cases ***
interact with browser
  create webdriver    Chrome
  go to    http://robotframework.org
  location should be  https://robotframework.org

In both cases Chromium opens, however the URL bar is set to data:, and stays that way until I close the browser. No errors are reported until I close the browser. The console output for the first test case (the second is just the same with a different name) is as below:

$ robot open-chromium.robot
==============================================================================
Open-Chromium :: Open Chromium on a given URL.                                
==============================================================================
interact with browser                                                 | FAIL |
SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
...

What's going on?


Solution

  • It turns out that ChromeDriver had to be installed from the package manager:

    sudo apt install chromium-chromedriver
    

    After running the command above both test cases work as expected.