Import/Publish automation test results from TestNG, JUnit, Cucumber, Robot, HPUFT, or QAF frameworks into QMetry **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*: Orig...
Accepts file system path (file); High parameter count (17 properties); Single-target operation
Part of the SmartBear MCP MCP server. Enforce policies on this tool with Intercept, the open-source MCP proxy.
AI agents use qmetry_import_automation_test_results to create or modify resources in SmartBear MCP. Write operations carry medium risk because an autonomous agent could trigger bulk unintended modifications. Rate limits prevent a single agent session from making hundreds of changes in rapid succession. Argument validation ensures the agent passes expected values.
Without a policy, an AI agent could call qmetry_import_automation_test_results repeatedly, creating or modifying resources faster than any human could review. Intercept's rate limiting ensures write operations happen at a controlled pace, and argument validation catches malformed or unexpected inputs before they reach SmartBear MCP.
Write tools can modify data. A rate limit prevents runaway bulk operations from AI agents.
tools:
qmetry_import_automation_test_results:
rules:
- action: allow
rate_limit:
max: 30
window: 60 See the full SmartBear MCP policy for all 147 tools.
Import/Publish automation test results from TestNG, JUnit, Cucumber, Robot, HPUFT, or QAF frameworks into QMetry **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 ```json { "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 2. JUnit results with custom test suite name ```json { "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 3. Cucumber results with platform and release mapping ```json { "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 4. Reuse existing test suite ```json { "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 5. Import with folder organization ```json { "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 6. Import with test case custom fields ```json { "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 7. Import ZIP file with multiple results ```json { "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 8. Import with custom hierarchy for JUnit ```json { "file": "<base64_encoded_junit_xml_content>", "fileName": "junit-results.xml", "entityType": "JUNIT", "automationHierarchy": "3", "projectID": "PROJ" } ``` Expected Output: Multiple test suites created per <testsuite> tag, test cases per <testcase> tag 9. Import with build and platform mapping ```json { "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 10. Import with test suite and test case fields ```json { "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): <class name> = Test Case, <test-method> = Test Step 21. * 2: <test-method> = Test Case only 22. * 3: <name> under <test> = Test Case, <test-method> = Test Step 23. - JUnit: 24. * 1 (default): <testsuite> = Test Case, <testcase> = Test Step 25. * 2: <testcase> = Test Case only 26. * 3: <testsuite> = Test Suite, <testcase> = 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. It is categorised as a Write tool in the SmartBear MCP MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
Add a rule in your Intercept YAML policy under the tools section for qmetry_import_automation_test_results. You can allow, deny, rate-limit, or validate arguments. Then run Intercept as a proxy in front of the SmartBear MCP MCP server.
qmetry_import_automation_test_results is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the qmetry_import_automation_test_results rule in your Intercept policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the Intercept policy for qmetry_import_automation_test_results. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
qmetry_import_automation_test_results is provided by the SmartBear MCP MCP server (@smartbear/mcp). Intercept sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Open source. One binary. Zero dependencies.
npx -y @policylayer/intercept