- Base Image: Python 3.14.0-slim-trixie
This docker container contains:
- Python 3.14.0
- Selenium 4.36.0
- RobotFramework 7.3.2
- SeleniumLibrary 6.8.0
- Chromium & ChromeDriver 131.0.6778.204
- Requests 2.32.5
- Beautifulsoup4 4.14.2
- Flask 3.1.2
- docker build . -t {tagname}
- docker pull moleszek/robotframework:latest
- docker run -it --rm -v {localFolderPath}:/robot moleszek/robotframework:latest -m robot {robotTest}.robot
Inside the keywords section add:
*** Keywords ***
Chromium Headless
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument --disable-extensions
Call Method ${chrome_options} add_argument --headless
Call Method ${chrome_options} add_argument --disable-gpu
Call Method ${chrome_options} add_argument --no-sandbox
Call Method ${chrome_options} add_argument --disable-dev-shm-usage
Evaluate setattr($chrome_options, 'binary_location', '/usr/bin/chromium')
${service}= Evaluate sys.modules['selenium.webdriver.chrome.service'].Service(executable_path='/usr/bin/chromedriver') sys, selenium.webdriver.chrome.service
Create Webdriver Chrome options=${chrome_options} service=${service}This keyword allows to run Chromium in headless mode.
See example.