Skip to content

Robot Framework Environment

In order to simplify the execution of Robot Framework tests, OpenTestFactory proposes a Docker image of such an execution environment: opentestfactory/robot-framework-runner.

Image content

Robot Framework libraries

Tools

  • Xvfb
  • openssh-server
  • x11vnc

Using the image

User profile

The image is designed to support running tests as otf. Running tests as root or any other non-otf will result in issues.

Starting the image

docker run -d \
  --name robotenv \
  --env PASSWORD_ACCESS=true \
  --env USER_PASSWORD=<secret password> \
  opentestfactory/robot-framework-runner:latest

Note: If USER_PASSWORD is not specified, the default password is otf.

Running a test via ssh

(We assume the test is accessible from within the image.)

ssh otf@<IP of the container> robot test_example.robot

The ssh port is 22 by default. Use the SSHD_PORT environment variable to change this value: docker run -d … --env SSHD_PORT=<your-port> … to change it.

Xvfb

When using ssh or docker exec to run a test, the display 99 is loaded.

Using Chromium browser

Browser Library is built on top of Playwright. In order to be able to test with Chromium and Playwright inside a container, a copy of seccomp_profile.json security settings is required, this file can be retrieved here. Some explanations can be found in Playwright documentation.

Using --ipc=host is recommended, otherwise Chromium may run out of memory.

To summarize, the --ipc=host --security-opt seccomp=seccomp_profile.json flags should be used:

docker run -d \
  --name robotenv \
  --env PASSWORD_ACCESS=true \
  --env USER_PASSWORD=<secret password> \
  --ipc=host \
  --security-opt seccomp=path/to/seccomp_profile.json \
  squashtest/agent-robotframework:latest"