Skip to main content

Mapping via JUnit XML

TESTMETRIX® can automatically link test case executions to test case definitions.

To do this, include a unique test case ID in the JUnit XML report.
This ID refers to a test case definition within a test case project.

This allows TESTMETRIX® to recognize:

  • which automated test was executed
  • which test case definition the execution belongs to
  • which requirements are covered by this execution


Purpose of the Mapping

The mapping between test execution and test case definition is the basis for requirement coverage.

Without mapping, TESTMETRIX® knows which test was executed, but not which test case definition or requirement it corresponds to.

Through the mapping, the following connection is created:

JUnit Test Execution
→ Test Case Definition
→ Low-Level Requirement


Passing the Test Case ID

The test case ID is passed as a property within a <testcase> element in the JUnit XML.

<testcase name="test_bluetooth_connection" classname="integration.bluetooth">
<properties>
<property name="integration_testsuite" value="013" />
</properties>
</testcase>

The value 013 corresponds to the ID of the test case definition in the test case project "integration_testsuite".

info

The property integration_testsuite must be named exactly the same as the associated test case project so TESTMETRIX® can automatically match the execution to the correct definition.



Example

JUnit Testcasetest_bluetooth_connection
Passed ID013
Linked Test Case Definition013 – Bluetooth Connection Test
Covered Requirements001-001, 001-002


Notes

  • The ID must match an existing test case definition in the test case project.
  • If the property is missing or the ID does not match, the execution won't be linked to any test case definition.
  • Multiple test executions can refer to the same test case definition.


Was this page helpful?