Skip to main content
TesterArmy renders any group run (batch) or single run as a JUnit XML report. The report is shaped for TestRail’s official importer, trcli parse_junit, and works with every CI test reporter that reads JUnit (GitHub dorny/test-reporter, GitLab artifacts:reports:junit, Jenkins, Buildkite, CircleCI).

Get the report

Open a group run under Results, open its actions menu, and choose Download JUnit report. The option appears once every run in the group has finished.

Import into TestRail

Install the TestRail CLI and point it at the file:
-y lets trcli create cases that do not exist yet. Omit it and pass -n to reject unknown cases instead.

Matching TesterArmy tests to TestRail cases

TestRail decides which case a result belongs to using --case-matcher: The classname is the TesterArmy group name and the name is the test title, so with auto each group becomes a TestRail section and each test a case.

What lands in TestRail

  • Status: passing runs are Passed. A FAILED verdict is a <failure> and imports as Failed. A BLOCKED verdict, a run that crashed before a verdict, or a run that finished without one is an <error> (type BLOCKED, the run error code, or MISSING_VERDICT); TestRail imports errors as Failed, and the testerarmy_result property keeps the distinction. Cancelled, planner-skipped, and unfinished runs are <skipped>.
  • Comment: the testrail_result_comment property holds the verdict, the agent’s summary, a link to the run in the dashboard, and screenshot URLs.
  • Steps: one testrail_result_step property per test step (passed:<step title>, failed:<step title>, or untested:<step title> for any other step status), so step results show up on the TestRail result when the case uses separated steps.
  • Elapsed: the time attribute is the run duration in seconds.
Preparation runs that only warm a session for the group are not exported.

Use it as a CI report

The same file works as a CI test report. Queue the group through POST /api/v1/groups/{groupId}/runs, keep the batchId from the response, and download the report once the batch has finished. On GitHub Actions:
On GitLab CI, declare the file under artifacts: reports: junit: so results render on the merge request.

Troubleshooting

409 BatchNotFinished

Runs are still queued or running. Wait for the batch, or add ?allowIncomplete=true to export the unfinished runs as skipped.

Every import creates new cases

You are using --case-matcher auto without an automation_id field, or the test titles changed. Switch to --case-matcher name and add [C<id>] to the TesterArmy test titles. trcli only uploads attachments from local file paths. The report carries screenshot URLs in the result comment; download them in CI and add testrail_attachment properties yourself if you need inline attachments.