Configure Field Mapping

Pre-requisites

Before you begin, ensure the following:

  • Ensure you have the XML automation result file.

To map XML fields with QMetry fields, perform the following steps:

QTM_ConfligureFieldMapping.png
  1. Go to Integration and select Custom Automation Template.

  2. Select New to create a new template or Edit an existing template.

  3. Enter Name and Description and click Next.

  4. On the Field Mapping screen, locate the fields to map.

  5. Enter the mapping expression for corresponding QMetry field.Mapping Expression Syntax

  6. Click Next to save the mapping.

  7. Import an XML result file to verify that QMetry populates the fields correctly.

The mapping is saved. When you import an XML automation result file using this template, QMetry populates the mapped fields based on the configured mapping expressions.

Configure the Default Status

The Default Status determines the outcome when none of the configured status mappings match the imported result.

Note

Default Status is configured only for the test case run.

Setting

Result

True

QMetry marks the execution as Passed.

False

QMetry marks the execution as Failed.

Note

Many automation frameworks, including JUnit, do not explicitly record a passed status. When importing results from these frameworks, set Default Status to True so that executions without failure, error, or skipped indicators are treated as Passed.

When an exact status mapping is unavailable, QMetry applies the following fallback rules.

XML Element

Default Behavior

<error>

Maps to Failed unless a custom Aborted status exists.

<skipped>

Maps to Not Applicable unless a custom Skipped status exists.

Configure the Date Format

The Date Format specifies how QMetry interprets date and time values during the import. The configured format must exactly match the format used in the XML file.

Note

Mapping Duration affects only duration calculations.

Table 53. Duration Calculation

Available XML Data

How QMetry calculates duration

Start time and end time

Duration = End Time − Start Time

Elapsed time only

Uses the mapped elapsed time value directly

Start time only

Uses the mapped start time as the execution start time. If no end time or elapsed time is available, duration cannot be calculated.



Example 51. XML
<testcase
    starttime="2025-01-15T10:30:00Z"
    endtime="2025-01-15T10:30:15Z"
    elapsedtime="15"/>

Mapping

Field

Expression

Result

Test Case Run Start Execution Time

${testsuites.testsuite.testcase:starttime}

2025-01-15 10:30:00 UTC

Test Case Run End Execution Time

${testsuites.testsuite.testcase:endtime}

2025-01-15 10:30:15 UTC

Test Case Run Execution Time

${testsuites.testsuite.testcase:elapsedtime}

15 seconds



Publication date: