Skip to main content
Glama
SmartBear

SmartBear MCP server

Official
by SmartBear

QMetry: Import Automation Test Results

qmetry_import_automation_test_results
Read-onlyIdempotent

Publish automation test results from TestNG, JUnit, Cucumber, Robot, HPUFT, or QAF files into QMetry, creating or updating test suites and cases while linking releases, cycles, builds, and platforms.

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:

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

TableJSON Schema
NameRequiredDescriptionDefault
fileYesBase64 encoded file content or file path. User must upload result file (.json, .xml, .zip up to 30 MB)
buildIDNoBuild ID or Build name
cycleIDNoCycle ID or Cycle name. Requires releaseID and projectID if provided
fileNameYesOriginal filename with extension (.json, .xml, or .zip)
projectIDNoProject ID, Project Key, or Project name. Overrides project in header
releaseIDNoRelease ID or Release name. Requires projectID if provided
entityTypeYesFormat of result file: TESTNG, CUCUMBER, JUNIT, HPUFT, QAF, or ROBOT
platformIDNoPlatform ID or Platform Name. Default: 'No Platform'
skipWarningNo0=Fail if summary >255 chars, 1=Truncate summary to 255 chars. Default: 0
testsuiteIdNoReuse existing Test Suite by ID or Entity Key. Ignored if automationHierarchy=3 for JUnit or =2 for ROBOT
tcFolderPathNoTest case folder path. Creates folder if doesn't exist. Ignored if reusing test case
tsFolderPathNoTest suite folder path. Creates folder if doesn't exist. Ignored if reusing test suite
testsuiteNameNoCustom test suite name. Ignored if automationHierarchy=3 for JUnit or =2 for ROBOT
testcase_fieldsNoJSON string with test case system fields and UDFs. Ignored if reusing test case. Example: {"component":["com1"], "priority":"High"}
testsuite_fieldsNoJSON string with test suite system fields and UDFs. Ignored if reusing test suite. Example: {"testSuiteState":"Open", "testsuiteOwner":"user"}
automationHierarchyNoTestNG/JUnit hierarchy: 1=Test Case-Test Step, 2=Test Case only, 3=Test Suite-Test Case. Default: 1
is_matching_requiredNoTrue=Create new TC if summary/steps don't match, False=Reuse linked TC. Default: True
Install Server

TDQS

A3.9/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true and idempotentHint=true, but the description describes a mutating operation: importing results creates/updates test suites, test cases, and execution results, and mentions folder creation and field updates. This contradicts the read-only annotation, creating an annotation contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely long but well-structured with clear sections (Parameters, Use Cases, Examples, Hints, Workflow). It contains some redundancy (e.g., double numbering, repeated reminders), but all sections provide useful operational context that earns their place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 17-parameter tool with no output schema, the description covers file requirements, entity types, hierarchy mappings, optional params, dependencies, field behavior, error handling, workflow, and expected outputs. It is exhaustive and would allow an agent to use the tool without needing external documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description's 'Parameters' and 'Hints' sections add extensive meaning beyond the schema: dependencies (cycleID requires releaseID and projectID), automationHierarchy behavior per framework, custom field formats, lookup-list behavior, error handling, and multiple examples. Even with full schema coverage, it enriches parameter semantics significantly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Import/Publish automation test results from TestNG, JUnit, Cucumber, Robot, HPUFT, or QAF frameworks into QMetry', clearly naming the verb, resource, and scope. It distinguishes this tool from sibling fetch/update/link tools, which all have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'Workflow' section provides a step-by-step process and the 'Use Cases' list specific scenarios (e.g., 'Import TestNG XML results after CI/CD pipeline execution'). However, it does not explicitly name alternative tools for cases not suited to import (e.g., manual test case creation), relying on the implied distinction from siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SmartBear/smartbear-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server