Understanding Field Mapping
Field Mapping defines how QMetry extracts data from an XML automation result file and maps it to the corresponding QMetry fields during import.
During the import, QMetry evaluates each mapping expression, extracts the corresponding values from the XML file, and populates the matching QMetry fields.
Supported Mapping Types
Depending on the information available in your XML file, you can map the following types of data:
Test case information
Test step information
Test suite information
Requirement identifiers
Execution status
Error messages and stack traces
Execution start time, end time, and duration
Attachments
Custom field values
Note
Only the Test Case Summary field is mandatory.
QMetry populates all other fields only if your XML file contains the information and you configure a mapping for those fields.
If a field is not mapped or the required information is not available in the XML file, QMetry leaves that field empty.
XML Field Types
XML stores data as:
Data Type | Description | Example | Mapping Expression |
|---|---|---|---|
XML element | Stores values between opening and closing tags. | <testsuite>
<testcase>
<status>Passed</status>
</testcase>
</testsuite> | ${testsuite.testcase.status} |
XML Attribute | Stores values within an element's opening tag. | <testsuite>
<testcase name="LoginTest"/>
</testsuite> | ${testsuite.testcase:name} |
Combination of Elements and Attributes | A mapping expression can reference both XML elements and attributes | <testsuite>
<testcase name="Login">
<status>Passed</status>
</testcase>
</testsuite> | ${testsuite.testcase:name} ${testsuite.testcase.status} |
QMetry supports mapping values from both XML elements and XML attributes. The mapping expression syntax varies depending on where the value is stored.
References
Execution Status Mapping Reference