QMetry: Import Automation Test Results
qmetry_import_automation_test_resultsImport automation test results from TestNG, JUnit, Cucumber, Robot, HPUFT, or QAF into QMetry for organized tracking and reporting with custom test suites, folders, and release mapping.
Instructions
Import/Publish automation test results from TestNG, JUnit, Cucumber, Robot, HPUFT, or QAF frameworks into QMetry
Toolset: Automation
Parameters:
file (string) required: Base64 encoded file content or file path. User must upload result file (.json, .xml, .zip up to 30 MB)
fileName (string) required: Original filename with extension (.json, .xml, or .zip)
entityType (enum) required: Format of result file: TESTNG, CUCUMBER, JUNIT, HPUFT, QAF, or ROBOT
automationHierarchy (enum): TestNG/JUnit hierarchy: 1=Test Case-Test Step, 2=Test Case only, 3=Test Suite-Test Case. Default: 1
testsuiteName (string): Custom test suite name. Ignored if automationHierarchy=3 for JUnit or =2 for ROBOT
testsuiteId (string): Reuse existing Test Suite by ID or Entity Key. Ignored if automationHierarchy=3 for JUnit or =2 for ROBOT
tsFolderPath (string): Test suite folder path. Creates folder if doesn't exist. Ignored if reusing test suite
tcFolderPath (string): Test case folder path. Creates folder if doesn't exist. Ignored if reusing test case
platformID (string): Platform ID or Platform Name. Default: 'No Platform'
projectID (string): Project ID, Project Key, or Project name. Overrides project in header
releaseID (string): Release ID or Release name. Requires projectID if provided
cycleID (string): Cycle ID or Cycle name. Requires releaseID and projectID if provided
buildID (string): Build ID or Build name
testcase_fields (string): JSON string with test case system fields and UDFs. Ignored if reusing test case. Example: {"component":["com1"], "priority":"High"}
testsuite_fields (string): JSON string with test suite system fields and UDFs. Ignored if reusing test suite. Example: {"testSuiteState":"Open", "testsuiteOwner":"user"}
skipWarning (enum): 0=Fail if summary >255 chars, 1=Truncate summary to 255 chars. Default: 0
is_matching_required (string): True=Create new TC if summary/steps don't match, False=Reuse linked TC. Default: True
Use Cases: 1. 1. Import TestNG XML results after CI/CD pipeline execution 2. 2. Publish JUnit test results to QMetry for tracking and reporting 3. 3. Upload Cucumber JSON results with custom test suite organization 4. 4. Import Robot Framework results with specific release/cycle mapping 5. 5. Link automation results to existing test suites for version tracking 6. 6. Create new test suites with custom names and folder structures 7. 7. Map test results to specific platforms (browsers, OS, devices) 8. 8. Associate imported results with releases, cycles, and builds 9. 9. Bulk import multiple test results from ZIP archive 10. 10. Configure test case/suite fields and user-defined fields during import
Examples:
Basic TestNG result import
{
"file": "<base64_encoded_testng_xml_content>",
"fileName": "testng-results.xml",
"entityType": "TESTNG"
}Expected Output: Auto-generated test suite created with UTC timestamp, test cases auto-linked, execution results updated, 'No Platform' linked
JUnit results with custom test suite name
{
"file": "<base64_encoded_junit_xml_content>",
"fileName": "junit-results.xml",
"entityType": "JUNIT",
"testsuiteName": "Regression Suite - Build 123",
"automationHierarchy": "1"
}Expected Output: Test suite 'Regression Suite - Build 123' created with Test Case-Test Step hierarchy
Cucumber results with platform and release mapping
{
"file": "<base64_encoded_cucumber_json_content>",
"fileName": "cucumber-results.json",
"entityType": "CUCUMBER",
"platformID": "Chrome 120",
"releaseID": "Release 2.0",
"cycleID": "Sprint 15",
"testsuiteName": "API Automation Tests"
}Expected Output: Test suite created, linked to Chrome platform, Release 2.0, and Sprint 15 cycle
Reuse existing test suite
{
"file": "<base64_encoded_testng_xml_content>",
"fileName": "testng-regression.xml",
"entityType": "TESTNG",
"testsuiteId": "PROJ-TS-42"
}Expected Output: Test cases auto-linked to existing test suite PROJ-TS-42, execution results updated
Import with folder organization
{
"file": "<base64_encoded_junit_xml_content>",
"fileName": "junit-results.xml",
"entityType": "JUNIT",
"tsFolderPath": "/Automation/Regression",
"tcFolderPath": "/Automation/API Tests",
"testsuiteName": "API Regression Suite"
}Expected Output: Test suite created in '/Automation/Regression' folder, test cases in '/Automation/API Tests' folder
Import with test case custom fields
{
"file": "<base64_encoded_testng_xml_content>",
"fileName": "testng-results.xml",
"entityType": "TESTNG",
"testcase_fields": "{\"priority\":\"High\",\"testCaseType\":\"Automated\",\"component\":[\"API\",\"Backend\"],\"testcaseOwner\":\"john.doe\",\"estimatedTime\":\"2h:30m:0s\"}"
}Expected Output: Test cases created with High priority, Automated type, API and Backend components
Import ZIP file with multiple results
{
"file": "<base64_encoded_zip_content>",
"fileName": "test-results.zip",
"entityType": "JUNIT",
"testsuiteName": "Full Regression Suite",
"skipWarning": "1"
}Expected Output: Multiple test results imported from ZIP, summaries truncated if >255 chars
Import with custom hierarchy for JUnit
{
"file": "<base64_encoded_junit_xml_content>",
"fileName": "junit-results.xml",
"entityType": "JUNIT",
"automationHierarchy": "3",
"projectID": "PROJ"
}Expected Output: Multiple test suites created per tag, test cases per tag
Import with build and platform mapping
{
"file": "<base64_encoded_testng_xml_content>",
"fileName": "testng-results.xml",
"entityType": "TESTNG",
"buildID": "Build-1.2.3",
"platformID": "Safari 17",
"releaseID": "Release 1.2",
"cycleID": "QA Cycle"
}Expected Output: Results linked to Build 1.2.3, Safari 17 platform, Release 1.2, QA Cycle
Import with test suite and test case fields
{
"file": "<base64_encoded_cucumber_json_content>",
"fileName": "cucumber-results.json",
"entityType": "CUCUMBER",
"testsuite_fields": "{\"testSuiteState\":\"In Progress\",\"testsuiteOwner\":\"jane.smith\",\"description\":\"Sprint 15 automation results\"}",
"testcase_fields": "{\"priority\":\"Medium\",\"component\":[\"UI\",\"Frontend\"],\"userDefinedFields\":{\"reviewedDate\":\"11-20-2024\",\"environment\":\"Staging\"}}"
}Expected Output: Test suite and test cases created with custom fields and UDFs
Hints: 1. 1. CRITICAL: User MUST upload a valid result file before calling this tool 2. 2. USER FILE UPLOAD REQUIRED: Ask user to provide file in chat - system will convert to base64 3. 3. FILE REQUIREMENTS: 4. - Supported extensions: .json, .xml, .zip 5. - Maximum size: 30 MB 6. - ZIP files must contain files matching the specified entityType format 7. 4. REQUIRED PARAMETERS: 8. - file: Base64 encoded content or file path 9. - fileName: Original filename with extension 10. - entityType: TESTNG, CUCUMBER, JUNIT, HPUFT, QAF, or ROBOT 11. 5. ENTITY TYPES: 12. - TESTNG: TestNG XML format 13. - JUNIT: JUnit XML format 14. - CUCUMBER: Cucumber JSON format 15. - ROBOT: Robot Framework XML format 16. - HPUFT: HP UFT format 17. - QAF: QAF format 18. 6. AUTOMATION HIERARCHY (TestNG/JUnit only): 19. - TestNG: 20. * 1 (default): = Test Case, = Test Step 21. * 2: = Test Case only 22. * 3: under = Test Case, = Test Step 23. - JUnit: 24. * 1 (default): = Test Case, = Test Step 25. * 2: = Test Case only 26. * 3: = Test Suite, = Test Case (creates multiple test suites) 27. 7. TEST SUITE OPTIONS: 28. - testsuiteName: Custom name for new test suite 29. - testsuiteId: Reuse existing test suite by ID or Entity Key (e.g., 'PROJ-TS-42') 30. - tsFolderPath: Create test suite in specific folder (e.g., '/Automation/Regression') 31. - Note: testsuiteName/testsuiteId ignored if automationHierarchy=3 for JUnit or =2 for ROBOT 32. 8. TEST CASE OPTIONS: 33. - tcFolderPath: Create test cases in specific folder (e.g., '/Automation/API Tests') 34. - Folders created automatically if they don't exist 35. 9. LINKING OPTIONS: 36. - platformID: Platform ID or name (e.g., 'Chrome 120', 'Safari 17') 37. - projectID: Project ID, key, or name (overrides header project) 38. - releaseID: Release ID or name (requires projectID) 39. - cycleID: Cycle ID or name (requires releaseID and projectID) 40. - buildID: Build ID or name 41. 10. GET IDs FROM OTHER TOOLS: 42. - Platform IDs: Use 'Platform/List' API (FETCH_PLATFORMS tool) 43. - Project IDs: Use 'Project/List' API (FETCH_PROJECTS tool) 44. - Release IDs: Use 'Release/List' API (FETCH_RELEASES_CYCLES tool) 45. - Cycle IDs: Use 'Cycle/List' API (FETCH_RELEASES_CYCLES tool) 46. - Build IDs: Use 'Build/List' API (FETCH_BUILDS tool) 47. - Test Suite IDs: Use 'Testsuite/Fetch' API (FETCH_TEST_SUITES tool) 48. 11. CUSTOM FIELDS (testcase_fields): 49. - JSON string with system fields and UDFs 50. - System fields: component, priority, testCaseState, testCaseType, testcaseOwner, estimatedTime, description 51. - Example: {"component":["API"], "priority":"High", "testcaseOwner":"user"} 52. - Ignored if reusing existing test case 53. 12. CUSTOM FIELDS (testsuite_fields): 54. - JSON string with system fields and UDFs 55. - System fields: testSuiteState, testsuiteOwner, description 56. - Example: {"testSuiteState":"Open", "testsuiteOwner":"user"} 57. - Ignored if reusing existing test suite 58. 13. USER DEFINED FIELDS (UDFs): 59. - Include in testcase_fields or testsuite_fields under 'userDefinedFields' key 60. - Example: {"userDefinedFields": {"reviewedDate": "11-20-2024", "environment": "Staging"}} 61. - UDF types: STRING, LARGETEXT, LOOKUPLIST, MULTILOOKUPLIST, DATEPICKER, NUMBER 62. - See tool metadata for UDF validation rules and auto-create behavior 63. 14. SKIP WARNING OPTIONS: 64. - skipWarning='0' (default): Fail import if test case summary >255 characters 65. - skipWarning='1': Truncate summary to 255 characters and continue import 66. 15. MATCHING BEHAVIOR: 67. - is_matching_required='true' (default): Create new TC/version if summary/steps don't match 68. - is_matching_required='false': Reuse existing TC version if entity key or summary matches 69. 16. IMPORT BEHAVIOR EXAMPLES: 70. - Only file + entityType → Auto-generated test suite, 'No Platform', test cases auto-linked 71. - file + entityType + platformID → Auto-generated test suite with specified platform 72. - file + entityType + testsuiteId → Results updated in existing test suite 73. - file + entityType + platformID + testsuiteId → Results updated in existing test suite with platform 74. 17. FOLDER CREATION: 75. - If tsFolderPath or tcFolderPath specified and doesn't exist, it will be created automatically 76. - Use forward slashes for folder paths (e.g., '/Parent/Child') 77. 18. ESTIMATED TIME FORMAT: 78. - Format: '2h:30m:15s' or '4h' or '7m' or '0s' 79. - Range: 0 to 99999 minutes 80. 19. OWNER FIELDS: 81. - Use userAlias (username) not display name 82. - testcaseOwner: User must have Test Case module rights 83. - testsuiteOwner: User must have Test Suite module rights 84. - Owner not set if user not found or lacks permissions 85. 20. LOOKUPLIST/MULTILOOKUPLIST BEHAVIOR: 86. - If value doesn't exist and auto-create is ON: Value added to list 87. - If value doesn't exist and auto-create is OFF: Field blank or default value 88. - MULTILOOKUPLIST: New values added, old values persist 89. 21. MANDATORY FIELD VALIDATION: 90. - If mandatory system/UDF field missing: 91. * Auto-create OFF + value doesn't exist = Import FAIL 92. * Auto-create ON + value doesn't exist = Import SUCCESS (value created) 93. * Value exists = Import SUCCESS 94. 22. ERROR HANDLING: 95. - Check file size before upload (must be ≤30 MB) 96. - Validate file extension matches entityType 97. - Ensure required dependencies: cycleID requires releaseID and projectID 98. - If import fails, check QMetry UI for detailed error messages 99. 23. WORKFLOW: 100. Step 1: Ask user to upload result file in chat 101. Step 2: System converts file to base64 102. Step 3: Collect entityType and optional parameters 103. Step 4: Call this tool with file data and configuration 104. Step 5: QMetry processes file and creates/updates test artifacts 105. Step 6: Return import results with test suite and execution details 106. 24. USER INTERACTION REQUIRED: 107. - ALWAYS ask user to upload file before calling this tool 108. - Display supported formats: .json, .xml, .zip (up to 30 MB) 109. - Ask for entityType (framework used) 110. - Ask for optional parameters based on user's needs 111. 25. PERFORMANCE TIPS: 112. - For large imports, consider using ZIP files 113. - Reusing existing test suites is faster than creating new ones 114. - Use automationHierarchy wisely to control test case/suite structure
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Base64 encoded file content or file path. User must upload result file (.json, .xml, .zip up to 30 MB) | |
| buildID | No | Build ID or Build name | |
| cycleID | No | Cycle ID or Cycle name. Requires releaseID and projectID if provided | |
| fileName | Yes | Original filename with extension (.json, .xml, or .zip) | |
| projectID | No | Project ID, Project Key, or Project name. Overrides project in header | |
| releaseID | No | Release ID or Release name. Requires projectID if provided | |
| entityType | Yes | Format of result file: TESTNG, CUCUMBER, JUNIT, HPUFT, QAF, or ROBOT | |
| platformID | No | Platform ID or Platform Name. Default: 'No Platform' | |
| skipWarning | No | 0=Fail if summary >255 chars, 1=Truncate summary to 255 chars. Default: 0 | |
| testsuiteId | No | Reuse existing Test Suite by ID or Entity Key. Ignored if automationHierarchy=3 for JUnit or =2 for ROBOT | |
| tcFolderPath | No | Test case folder path. Creates folder if doesn't exist. Ignored if reusing test case | |
| tsFolderPath | No | Test suite folder path. Creates folder if doesn't exist. Ignored if reusing test suite | |
| testsuiteName | No | Custom test suite name. Ignored if automationHierarchy=3 for JUnit or =2 for ROBOT | |
| testcase_fields | No | JSON string with test case system fields and UDFs. Ignored if reusing test case. Example: {"component":["com1"], "priority":"High"} | |
| testsuite_fields | No | JSON string with test suite system fields and UDFs. Ignored if reusing test suite. Example: {"testSuiteState":"Open", "testsuiteOwner":"user"} | |
| automationHierarchy | No | TestNG/JUnit hierarchy: 1=Test Case-Test Step, 2=Test Case only, 3=Test Suite-Test Case. Default: 1 | |
| is_matching_required | No | True=Create new TC if summary/steps don't match, False=Reuse linked TC. Default: True |