Skip to content

Reprocessing with rebot

Chapter lab: Tests, tasks, and reportsch24-tests-tasks-and-reports.zip · 15 KB

This lesson continues in the same lab as the lesson before it. If you don’t have it yet, download it here.

Download ch24-tests-tasks-and-reports.zip

Or fetch and unpack it from a terminal in VS Code:

Terminal window
curl -fsSLO https://manykarim.github.io/robotframework-essentials-web/labs/ch24-tests-tasks-and-reports.zip && unzip -q ch24-tests-tasks-and-reports.zip && rm ch24-tests-tasks-and-reports.zip

Open the folder in VS Code with code rfe-ch24-tests-tasks-and-reports (or File → Open Folder…) and accept the recommended RobotCode and Python extensions. Then set it up:

Terminal window
uv sync
Terminal window
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Keep the environment active in every terminal where you run lesson commands.

Terminal window
poetry install --no-root

Python 3.13 or newer is required; uv installs it when it is missing.

Open in browserNo setup? Try the lab right here: its files, an editor and a terminal, running in your browser.

What's inside
  • Directoryrfe-ch24-tests-tasks-and-reports/
    • Directory.vscode/
      • extensions.json
    • Directorychecks/
      • alpha.robot
      • beta.robot
      • unformatted.robot
    • .gitignore
    • .python-version
    • LAB.md
    • pyproject.toml
    • README.md
    • requirements.txt
    • uv.lock

Every run writes an output.xml — the machine-readable record of what happened. The log.html and report.html are generated from it. That means you can regenerate and reshape results after a run, without re-running anything, using rebot.

Two everyday uses:

  • Combine several outputs into one report — the natural fit for suites run separately (or in parallel shards, next chapter).
  • Merge a rerun of failures back into the original result (rebot --merge) — the CI pattern for retrying flaky tests without re-running the whole suite.
Reprocessing results with rebotpipeline diagram. Regenerated from output.xml, so no test is re-runoutput.xml filesfrom separate runsrebotcombine or --mergecombined reportlog.html and report.htmlRegenerated from output.xml, so no test is re-run
Run

Run the two suites, each to its own output file:

Terminal window
uv run robot --outputdir results --output alpha.xml checks/alpha.robot
uv run robot --outputdir results --output beta.xml checks/beta.robot
Terminal window
robot --outputdir results --output alpha.xml checks/alpha.robot
robot --outputdir results --output beta.xml checks/beta.robot
Terminal window
poetry run robot --outputdir results --output alpha.xml checks/alpha.robot
poetry run robot --outputdir results --output beta.xml checks/beta.robot

Done when

results/alpha.xml and results/beta.xml both exist.

Run

Now fold both outputs into a single combined result with rebot:

Terminal window
uv run rebot --outputdir results --output combined.xml results/alpha.xml results/beta.xml
Terminal window
rebot --outputdir results --output combined.xml results/alpha.xml results/beta.xml
Terminal window
poetry run rebot --outputdir results --output combined.xml results/alpha.xml results/beta.xml

Two separate runs, then one rebot folds them into a single report:

uv run robot --outputdir results --output alpha.xml checks/alpha.robotrobot --outputdir results --output alpha.xml checks/alpha.robotpoetry run robot --outputdir results --output alpha.xml checks/alpha.robot
2 tests, 2 passed, 0 failed
uv run robot --outputdir results --output beta.xml checks/beta.robotrobot --outputdir results --output beta.xml checks/beta.robotpoetry run robot --outputdir results --output beta.xml checks/beta.robot
2 tests, 2 passed, 0 failed
uv run rebot --outputdir results --output combined.xml results/alpha.xml results/beta.xmlrebot --outputdir results --output combined.xml results/alpha.xml results/beta.xmlpoetry run rebot --outputdir results --output combined.xml results/alpha.xml results/beta.xml
Output: results/combined.xml
Log: results/log.html
Report: results/report.html

results/combined.xml (and its log.html/report.html) now covers all four tests from both suites — no test was re-run.

Done when

the combined output holds all four tests, all passing.

Check your understanding

Quick recall. Your first answer stays in this browser; the quiz never blocks your progress.

  1. rebot works from…

    Show the answer

    Answer: a saved output.xml — rebot regenerates and reshapes reports from output.xml — no tests re-run.

  2. rebot --merge is the pattern for…

    Show the answer

    Answer: folding a rerun of failures back into the original result — Merge updates the original result with a rerun — the CI approach to retrying flaky tests.

Key terms

rebotcommand
Regenerate/combine reports from saved output.xml files.
--mergecommand
Fold a rerun of failures back into an earlier result.

All terms in the glossary →