Table of Contents | ||
---|---|---|
|
...
Rest API URL that would be used. For Cloud customers, it should be https://testmanagement.qmetry.com/rest/import/createandscheduletestresults/1
Method: "POST"
Header Details
Parameter
Value
Required
project
project key OR project name OR project id OR default
Yes
apikey
Copy from the screen. It's an autogenerated key that is specific to a user login
Yes
Body Parameters
Name | Located in | Required | Description | Default | Schema |
---|---|---|---|---|---|
file | formData | yes | Your result file to be uploaded. Supported file extensions: .json, .xml and .zip (zip file must contain files of the format given in the 'entityType' param Note: Result File upto 30 MB can be imported using Automation API. | - | string |
entityType | formData | yes | Format of result file to be imported. Supported formats: TESTNG or CUCUMBER or JUNIT or HPUFT or QAF or ROBOT | - | string |
automationHierarchy | formData | no | The parameter applies only when you are importing results for TestNG and JUnit frameworks. Define the hierarchy of a Test case i.e. Test Case-Test Step or Test Case or Test Suite-Test Case. TestNG 1 Create Test Case -Test Step. The tag <class name> under <test> tag is referred as Test Case and tag <test-method> as Test Step. (The default value is 1) 3 Create Test Case -Test Step. The tag <name> under <test> tag is referred as Testcase and tag <test-method> as Test Step JUnit 1 Create Test Case-Test Step. The tag <testsuite> referred as Test Case and tag <testcase> as Test Step. (The default value is 1) JUnit File Type 1: Wherein testsuite "name" matches the test case "classname".
JUnit File Type 2: Wherein testsuite "name" does not match the test case "classname".
3 Create Test Suite-Test Case. The tag <testsuite> referred as Test Suite and tag <testcase> referred as Test Case.In this case multiple Test Suites will be created. | 1 | string |
testsuiteName | formData | no | By default auto generated test suite name would be created. To provide your desired test suite name use this parameter. Note :
| - | string |
testsuiteId | formData | no | This parameter is used if you want to reuse an existing Test Suite. Parameter accepted Test Suite ID or Testsuite Entity Key. Testsuite id can be fetched using List Testsuite API or the Entity Key can be obtained from detail view of target Test Suite. Note :
| - | string |
tsFolderPath | formData | no | New test suites will be created in a specified test suite folder while importing automated test results. If the folder does not exist, it gets created. This parameter will be ignored if the test suite is being reused. | - | string |
platformID | formData | no | Target Platform Id or Platform Name. Platform Id can be fetched using List Platform API and Platform Name can be obtained from detail view of target Platform. | No Platform | string |
projectID | formData | no | Target Project ID or Project Key or Project name. Project id can be fetched using List Project API and the Entity Key or name can be obtained from list view of target Project. Note: If Project ID is passed, then it will override the value of project in Header. | - | string |
releaseID | formData | no | Target Release ID or Release name. Release id can be fetched using List Release API from list detail of target Project. Pass projectID if you are passing releaseID. | - | string |
cycleID | formData | no | Target Cycle Id or Cycle Name. Cycle Id can be fetched using List Cycle API and Cycle Name can be obtained from detail view of target Cycle. Pass releaseID and projectID if you are passing cycleID | - | string |
buildID | formData | no | Target Build ID or Build name. Build id can be fetched using List Build API from list detail of target Project. | - | string |
testcase_fields | formData | no | Mention system defined fields and user defined fields for test case as shown in Test Case JSON format. All the mandatory fields other than Summary should be mentioned in this parameter. This parameter will be ignored if the existing test case is reused while uploading the results. System fields and UDFs will be set only if a new version of the reused test case or a new test case is created. | - | JSON |
testsuite_fields | formData | no | Mention system defined fields and user defined fields for test suite as shown inTest Suite JSON format. All the mandatory fields other than Summary should be mentioned in this parameter. This parameter will be ignored if existing Test suite Id is used to upload results. | - | JSON |
skipWarning | formData | no | 0 Test Case Import will be failed if the result file contains test case summary with more than 255 characters. 1 Test Cases can be imported by ignoring the warning about summary length. If the test case summary is longer, it will be truncated to 255 characters. | 0 | string |
is_matching_required | formData | no | True - Create a new test case or test case version if the test summary and steps of any of the test case versions do not match with the test case in the result file. False - Reuse already linked test case version in test suite or auto link the existing latest version of test case to test suite, if the test case entity key OR test case summary matches with the test case in the result file. The execution status of the linked test cases will be updated. | True | string |
...
Python Example
Pre-requisties : Python 3, pip3, requests
Download Sample Code - importResult importResult.py file below
View file | ||
---|---|---|
|
...