NUnit XML report
This guide explains the basic structure of a NUnit XML report, helping you understand how AgileTest reads and displays report data. Additionally, you can learn how to customize the report to add attachment details.
1. Common structure of NUnit report
Below is the common structure of the NUnit XML report. The following sections illustrate the common formats used in NUnit 2.6 and NUnit 3.
1.1 NUnit 2.6 format
In an NUnit 2.6 report, test results are organized into test suites and test cases. The report uses the <test-results> element to group multiple <test-suite> elements. Each test suite can contain several test cases.

NUnit 2.6 test report structure diagram
In a basic NUnit report, you will find common tags representing test suites and test cases.
1.2 NUnit 3 format
In the NUnit 3 report, test results are organized into test runs, test suites, and test cases. The report starts with the <test-run> element that contains multiple <test-suite> elements. Each test suite can further contain multiple <test-case> elements.

NUnit 3 test report structure diagram
Once you understand the structure of an NUnit report, the next step is to see how AgileTest interprets this data when the report is imported. AgileTest reads specific elements in the XML file to create test cases and determine their execution status.
2. How AgileTest would parse an NUnit report
Imported test cases are distinguished by the name attribute of the <test-case> element parsed from the XML file. This information appears as the Test Definition in AgileTest after parsing and can be found just below the Description section of the test case ticket. The Summary of each test case issue is based on the value of the name attribute.
Each report file, after execution, contains NUnit status values automatically mapped to AgileTest Test Results. Therefore, you do not need extra setup to read test results.
Below are explanations for the supported status of the NUnit reports in AgileTest.
Prioritization rule for determining the test status in AgileTest:
If multiple tags are added to a single
<test-case>element, the tag with the highest priority will be used as the test status in AgileTest.The priority of status tags in AgileTest is as follows: FAILED > BLOCKED > RETEST > SKIPPED > QUERY > PASSED.
In the NUnit report, test case status is calculated based on the status tag in the test-case tag. The following table shows how NUnit status values are mapped to AgileTest execution statuses.
Test case status | Description |
| PASSED → Test case yields the expected result. |
| FAILED → Test case returns the actual result, not as expected. |
| BLOCKED → Test case is considered blocked due to a specific reason. |
| SKIPPED→ Test case is skipped in the test run. |
| RETEST → Test case should be rerun again. |
| QUERY → The test case requires more details to have the final result. |
| TODO → Test case is not yet run. It’s the default status of every Test case in AgileTest. |
3. Add attachments in NUnit reports
By default, many reports do not include attachments. This section explains how to add attachments to your test reports.
AgileTest supports 2 customized structures for integrating attachments into your NUnit test reports. Users can choose either option to upload test results along with evidence files.
3.1 Attachment element with name attribute and content inside
To allow AgileTest to recognize attachments in the report, you need to follow a specific XML element structure.
<attachment name="filename"> base64 content </attachment>
For example, you can put this Element structure into your report like this:
<test-case>
...
<attachments>
<attachment name="test.png">iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAQ0lEQVR42u3PQREAAAgDINc/9Mzg14MGZNrOAxERERERERERERERERERERERERERERERERERERERERERERERERERuVh9TJWdbWjzsQAAAABJRU5ErkJggg==</attachment>
</attachments>
<test-case>
3.2 Attachment element with separate name and content elements inside
To allow AgileTest to recognize attachments in the report, you can add this element structure:
<attachment>
<name> filename </name>
<rawcontent> base64 content </rawcontent>
</attachment>
For example, your report will look like:
<test-case>
...
<attachments>
<attachment>
<name>test.png</name>
<rawcontent>iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAQ0lEQVR42u3PQREAAAgDINc/9Mzg14MGZNrOAxERERERERERERERERERERERERERERERERERERERERERERERERERuVh9TJWdbWjzsQAAAABJRU5ErkJggg==</rawcontent>
</attachment>
</attachments>
</test-case>
Should you need any assistance or further AgileTest inquiries, please contact us here!