Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
GimmeJob
Sign in
Test automation · Robot Framework · Chapter 06 / 07

Test automation learning path

06 · Running, CI & parallelism

Run repeatably, debug the first failure, use listener integrations, Rebot, Pabot and CI evidence.

A reproducible run

Preserve failing exit codes and upload evidence on failure. Rebot post-processes results; it does not rerun a test. Introduce Pabot only when data and environment ownership are already deterministic.

Listeners, pre-run modifiers and tool integrations

Use Robot's APIs for cross-cutting behavior instead of polluting every test.

When behavior is truly cross-cutting, Robot Framework provides extension APIs beyond ordinary libraries.

A listener receives execution events such as suite/test/keyword start and end. Typical uses include telemetry, custom evidence collection, external dashboards and integration with reporting systems. Keep listeners observational whenever possible; hidden mutation from listeners makes tests hard to reason about.

A pre-run modifier can inspect and modify the parsed execution model before tests run. This can support specialized selection or transformation use cases, but it is an advanced tool. Prefer normal tags and CLI selection when they are sufficient.

Robot Framework 7.5 also allows custom console loggers using the listener-style API. This can tailor CI console output without changing test data.

The architecture rule is simple: domain actions belong in keywords/libraries; lifecycle belongs in setup/teardown; cross-cutting observation belongs in listeners; test selection normally belongs in tags/CLI. Use each extension point for its intended responsibility.

Key points

  • Use listeners for observation and integrations
  • Prefer tags/CLI over pre-run mutation for normal selection
  • Avoid hidden behavior that changes test semantics

Common pitfalls

  • Putting business actions into a listener so the test file no longer shows what actually happens

CLI execution, output.xml, Rebot and debugging

Treat execution configuration and result post-processing as first-class parts of the framework.

Robot's CLI can select suites/tests/tags, set variables, control output locations and tune logging. Prefer scripts or CI commands that are explicit and reproducible.

python -m robot \
  --outputdir results \
  --variable ENV:staging \
  --include smoke \
  tests

Useful outputs include output.xml, log.html, report.html and optional xUnit-compatible output. output.xml can be post-processed with Rebot:

python -m rebot --outputdir merged results/output.xml

Rebot can combine multiple output files, adjust report generation and filter/transform result presentation without re-running tests.

For debugging, start with the earliest meaningful failure in log.html. Inspect variable values, keyword arguments, timestamps and setup/teardown results. Increase log level only when needed; very verbose logs can expose sensitive data and make failures harder to scan.

Robot Framework 7.5 improves console logging configuration and adds custom console loggers. Keep CI console output compact enough to spot the first failure while preserving full result artifacts for detailed investigation.

Key points

  • Keep output.xml because it enables post-processing
  • Make CLI options reproducible in scripts or CI
  • Debug from the first meaningful failure, not the final cascade

Common pitfalls

  • Discarding output artifacts on CI failure and leaving only console text

Parallel execution with Pabot

Parallelize only after tests are isolated and resources have clear ownership.

Pabot is the common parallel runner for Robot Framework.

python -m pip install robotframework-pabot
pabot --processes 4 --outputdir results tests

By default Pabot splits work at suite level. --testlevelsplit can split individual tests, but that changes lifecycle behavior: suite setup/teardown may execute for each parallel instance. Use it only when suite assumptions remain valid.

Parallel failures usually reveal hidden shared state: one test edits data another test expects, processes compete for the same device, or all workers reuse the same account. Fix isolation instead of adding random retries.

For scarce shared resources, PabotLib can coordinate locks and resource distribution. Sharding can distribute work across machines.

A good progression is: deterministic sequential suite → isolated suites → parallel suite-level execution → test-level split only if needed. Measure the actual bottleneck; a browser or external system may saturate before CPU does.

Key points

  • Parallelism amplifies state leaks; isolation comes first
  • Suite-level splitting is the safer default
  • Use locks/resource pools only for genuinely scarce shared resources

Common pitfalls

  • Turning on test-level parallelism before understanding suite setup/teardown and shared data

CI, reports and a production-ready execution workflow

Run Robot deterministically in CI and always preserve evidence.

A CI job should install pinned dependencies, initialize required external libraries, run tests, publish machine-readable results when useful, and preserve Robot artifacts even on failure.

Minimal core-only GitHub Actions example:

name: Robot Framework
on: [push, pull_request]

jobs:
  robot:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.13'
      - run: python -m pip install robotframework==7.5
      - run: python -m robot --outputdir results tests
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: robot-results
          path: results/

For Browser Library, use the bundled-runtime route with rfbrowser install or the external-Node route with rfbrowser init in CI. For API or system tests, inject credentials through the CI secret mechanism rather than repository files.

Tag-based jobs can provide quick smoke feedback while a broader regression job runs separately. Avoid duplicating execution rules in many YAML files; centralize commands in a script or task runner if the workflow becomes complex.

The artifact policy matters: a failed test run is exactly when screenshots, traces, output.xml and log.html are most valuable.

Key points

  • Pin dependencies for reproducible CI
  • Always preserve artifacts on failure
  • Inject credentials through CI secret storage

Common pitfalls

  • Making CI pass by suppressing the Robot process exit code without an explicit quarantine policy

Source registry

10 chapter references
Robot Framework User Guide

Core syntax, variables, control structures, suites, execution, output files and extension APIs

Robot Framework Foundation · Official documentation
Source ↗
Robot Framework Guides

Getting started, project structure, libraries, examples and CI guidance

Robot Framework Foundation · Official guides
Source ↗
Robot Framework releases

Current stable releases, maintenance status and release notes

Robot Framework · Official release history
Source ↗
Robot Framework Standard Libraries

BuiltIn, Collections, String, DateTime, OperatingSystem, Process, XML and other bundled libraries

Robot Framework Foundation · Official documentation
Source ↗
Robot Framework Browser

Playwright-backed web automation, locators, assertions, waiting and browser lifecycle

Robot Framework Browser contributors · Official documentation
Source ↗
Robot Framework RequestsLibrary

HTTP API testing with sessionless and session-based requests

MarketSquare / RequestsLibrary contributors · Official library documentation
Source ↗
Robot Framework Python libraries

Creating custom keywords and libraries in Python

Robot Framework Foundation · Official guide
Source ↗
Libdoc

Generating and inspecting library and resource-file documentation

Robot Framework Foundation · Official documentation
Source ↗
Running tests in parallel with Pabot

Parallel suite/test execution, process count, sharding and shared resources

Robot Framework Foundation · Official guide
Source ↗
Robot Framework in GitHub Actions

Running Robot Framework in CI and preserving reports

Robot Framework Foundation · Official guide
Source ↗