Skip to main content
New to Testkube? Unleash the power of cloud native testing in Kubernetes with Testkube. Get Started >

Basic Robot Framework Example

Below is a basic workflow for executing a Robot Framework test which is available on GitHub. You can paste this directly into the YAML of an existing or new test, just make sure to update the name and namespace for your environment if needed.

  • The spec.content property defines the location of the GitHub project
  • the spec.steps property defines a single step that runs the test and uploads the created reports.
Basic Robot Framework Workflow
apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
name: robotframework-browser-smoke
labels:
tool: robotframework-browser
category: e2e-ui-testing
junit: "true"
artifacts: "true"
spec:
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- test/robotframework/robotframework-project
container:
image: marketsquare/robotframework-browser:19.10
resources:
requests:
cpu: 1000m
memory: 1000Mi
workingDir: /data/repo/test/robotframework/robotframework-project
job:
activeDeadlineSeconds: 180
steps:
- name: Run Robot Framework tests
run:
shell: |
mkdir -p /data/artifacts && \
robot --outputdir /data/artifacts \
--xunit /data/artifacts/junit.xml \
--exclude negative \
tests/
env:
- name: ROBOT_SYSLOG_FILE
value: /data/artifacts/robot-syslog.txt
- name: Save artifacts
artifacts:
workingDir: /data/artifacts/
paths:
- '**/*'

This workflow demonstrates several key features:

  • Content Fetching: Uses git with paths to fetch only specific directories from the repository, reducing clone time and disk usage.
  • Resource Management: Configures CPU and memory requests to ensure adequate resources for browser-based testing.
  • Working Directory: Sets workingDir to run tests from the correct location in the repository.
  • Job Timeout: Uses activeDeadlineSeconds to limit test execution time and prevent hanging tests.
  • Multiple Steps: Separates test execution from artifact collection for better organization and reliability.
  • Environment Variables: Configures Robot Framework logging using environment variables.
  • JUnit Reports: Generates JUnit-compatible XML reports with the --xunit flag for integration with CI/CD systems.
  • Artifacts: Collects all test outputs (reports, logs, screenshots) using wildcard patterns for easy access and analysis.

After execution, you can see the output from the test executions under the executions panel tabs:

The log output from the Robot Framework execution:

Robot Framework Log Output