I’m seeking advice on setting up and running Robot Framework Browser tests within a CI environment. Here’s my current setup and the issues I’m encountering:
Setup:
Dockerfile Snippet:
FROM ubuntu:22.04
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash
&& apt-get update && apt-get install -y nodejs
Clone our private GitHub repository
RUN mkdir -p /home/sampleTest && cd /home/sampleTest
RUN git clone ...
Set working directory
WORKDIR /TEST/
Install Python dependencies and setup environment
RUN python3.8 -m venv venv
ENV PATH="/TEST/venv/bin:$PATH"
ENV PYTHONPATH=/TEST/config ...
RUN pip3 install --no-cache-dir --upgrade pip wheel &&
pip3 --version &&
pip3 install --no-cache-dir --upgrade robotframework robotframework-browser==14.1. &&
python3 -m Browser.entry init
But get this error when running tests
Initializing library ‘Browser’ with no arguments failed: TypeError: Formatter() takes no arguments
Also tried to set custom location by
PLAYWRIGHT_BROWSERS_PATH=TEST/pw-browsers npx playwright install
but get same error
Questions:
rfbrowser init Sufficiency: Is using rfbrowser init alone within the Dockerfile sufficient for setting up browsers in a CI environment, or are there additional steps required?
Approach Validity: Is using rfbrowser init to install browsers directly within the Docker image a viable approach for running Robot Framework Browser tests in CI?
Error Insight: Could someone shed light on the TypeError: Formatter() takes no arguments error encountered during rfbrowser init? Is this related to a missing configuration step or a potential version incompatibility?
Note
I know that there is an option to use a robot base image with pre-installed browsers, but this option does not suit me as I am using an older version of the robot.
2
Answers
I found what cause this problem, if someone else face with this issue, here is a topic with solution
Your example code is not minimal reproducable example so I can’t point out where exactly it goes wrong. However, I can paste a minimal example from my image. I normally use a different base image but it seemed to pass in Ubuntu, too.