skip to Main Content

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


  1. Chosen as BEST ANSWER

    I found what cause this problem, if someone else face with this issue, here is a topic with solution


  2. 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.

    FROM ubuntu:22.04
    RUN apt-get update && apt-get install -y python3 python3-pip
    RUN python3 -m pip install -q --upgrade pip
    
    ENV NODE_MAJOR=20
    RUN apt-get -q -y install ca-certificates curl gnupg 
        && mkdir -p /etc/apt/keyrings 
        && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key 
           | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg 
        && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" 
           > /etc/apt/sources.list.d/nodesource.list 
        && apt-get update 
        && apt-get -q -y install nodejs
    RUN pip3 install --no-cache-dir --upgrade robotframework robotframework-browser
    RUN rfbrowser init
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search