Menu

Test Log APIs

Revision table

# Release Date API New or Update Description of Change
1 03/31/2017 Batch Submit Test Logs and Create Test Cases and Test Runs in user-defined Hierarchical Structure New Available from qTest Manager v8.4.1
2 8/15/2017 Batch Submit Test Logs and Create Test Cases and Test Runs in user-defined Hierarchical Structure Update Ability to update Test Run system and custom fields using properties array

Batch Submit Test Logs and Create Test Cases and Test Runs in user-defined Hierarchical Structure

POST /api/v3/projects/{projectId}/auto-test-logs?type=automation

qTest Manager version: 8.4.1+

Description: This is the extended version of the Batch Submit Test Log API. It allows submitting multiple test logs in one API request, and creating Test Cases and Test Runs in hierarchical structure which is specified in the request body.

Path variable:

  • projectId: ID of the project

Request body:

Attribute Name Required Type Description
test_cycle Yes String PID or ID of the parent Test Cycle in qTest Manager where submitted Test Runs will be located
test_logs Yes JSONArray The array of TestLog objects. The below are TestLog attributes.
TestLog attributes
test_case_version_id No Number ID of the associated Test Case's version. In case the Test Case has not existed, this field should not be included or it will cause an error.
properties No JSonArray

Array of Test Run field-value pairs. It can be used to update any Test Run system and custom fields, except for the read-only fields. The submitted Test Log will inherit latest field values from its associated Test Run.

- If invalid field ID is specified, the field is ignored but the Test Log is still submitted

- If invalid value is specified, the Test Log is not submitted

status Yes String The automation result values that were mapped with Test Run Result in qTest automation settings
exe_start_date Yes DateTime Execution start time
exe_end_date Yes DateTime Execution end time
module_names Yes JSONArray Array of folder names which will be used when creating hierarchical structure in Test Design and Test Execution trees
  • In Test Design tree, the first folder will be created as a Module directly under the tree root. Other folders will be created as sub-Modules under their preceding folders in the array
  • In Test Execution tree, the first folder will be created as a Test Cycle directly under the parent Test Cycle which is specified in the API request. Other folders will be created as sub Test Cycles under their preceding folders in the array
  • If there is a folder in the tree with matching name and location, the API will not create a duplicate one
name Yes String It will be used when creating Test Cases and Test Runs as their names. It will not be used for updating Test Case and Test Run names
automation_content Yes String

Specify a unique string to each Test Case. It acts as Test Case fingerprint. Before adding a Test Log, qTest Manager will look up Automation Content of existing Test Cases. If it can find an existing Test Case, the Test Log will be associated with that Test Case. Otherwise, a new Test Case will be created with the submitted Test Log.

It is also be used when creating Test Runs. If qTest Manager finds an existing Test Run with matching Automation Content and location in Test Execution tree, it will not create a duplicate one. If there is an existing Test Run with matching Automation Content but it is located in different Test Cycles, qTest Manager will create a new Test Run in the specified folder.

attachments No JSONArray An array of the Attachment objects
test_step_logs No JSONArray An of TestStepLog objects. You can specify Test Steps' order in the requrest. It must be continous series of numbers, starting from zero, or it will throw an error. The order will be used when the Test Case is created or updated in qTest. If the order is omitted, Test Steps will be alphabetically sorted when creating or updating Test Case
Test Step Log attributes
description Yes String Description of the Test Step
expected_result Yes String Expected result of the Test Step
actual_result Yes String Actual result of the Test Step
status Yes String The automation result values that were mapped with Test Run Result in qTest automation settings
order No Number Specify the order of Test Steps. It must be continous series of numbers, starting from zero, or it will throw an error. The order will be used when the Test Case is created or updated in qTest. If the order is omitted, Test Steps will be alphabetically sorted when creating or updating Test Case

  IMPORTANT:

  • This API does not update names and locations of existing Test Cases and Test Runs

Request Sample

POST /api/v3/projects/33512/auto-test-logs?type=automation HTTP/1.1
Host: elite.qtestnet.com
Authorization: bearer --
Content-Type: application/json
Cache-Control: no-cache
{
  "test_cycle": "204294",
  "test_logs": [
    {
      "properties": [
        {
          "field_id": 2189290,
          "field_value": 501
        },
        {
          "field_id": 2189292,
          "field_value": 31124
        }
      ],
      "status": "PASSED",
      "exe_start_date": "2017-03-27T05:00:00+07:00",
      "exe_end_date": "2017-03-27T06:00:00+07:00",
      "module_names": [
        "test01~~``!!@@##$$%%^^**(())--==__++.,,..//??;;::[[]]{{}}||",
        "test02~~``!!@@##$$%%^^**(())--==__++.,,..//??;;::[[]]{{}}||"
      ],
      "name": "test_msd_ac4_dual_mixing_scale_main_combine[msd_ac4_generic_float32_release-208-94-228]",
      "automation_content": "test_msd_ac4_dual_mixing_scale_main_combine[msd_ac4_generic_float32_release-208-94-228]",
      "attachments": [
        {
          "name": "sample.demo.test1.txt",
          "content_type": "text/plain",
          "data": "dGhpcyBpcyBzYW1wbGUgdGVzdA=="
        },
        {
          "name": "sample.demo.test2.txt",
          "content_type": "text/plain",
          "data": "dGhpcyBpcyBzYW1wbGUgdGVzdA=="
        }
      ],
      "test_step_logs": [
        {
          "description": "demo b",
          "expected_result": "demo b",
          "actual_result": "demo b",
          "status": "FAILED",
          "order": 0
        },
        {
          "description": "demo c1",
          "expected_result": "demo c1",
          "actual_result": "demo c1",
          "status": "SKIPPED",
          "order": 1
        },
        {
          "description": "demo c2",
          "expected_result": "demo c2",
          "actual_result": "demo c2",
          "status": "PASSED",
          "order": 2
        },
        {
          "description": "demo a",
          "expected_result": "demo a",
          "actual_result": "demo a",
          "status": "PASSED",
          "order": 3
        }
      ]
    },
    {
      "test_case_version_id": 15233855,
      "status": "FAILED",
      "exe_start_date": "2017-03-27T05:00:00+07:00",
      "exe_end_date": "2017-03-27T06:00:00+07:00",
      "module_names": [
        "test01~~``!!@@##$$%%^^**(())--==__++.,,..//??;;::[[]]{{}}||",
        "test02~~``!!@@##$$%%^^**(())--==__++.,,..//??;;::[[]]{{}}||"
      ],
      "name": "test_msd_ac4_dual_mixing_scale_main_combine[msd_ac4_generic_float32_release-208-94-228]_02",
      "automation_content": "test_msd_ac4_dual_mixing_scale_main_combine[msd_ac4_generic_float32_release-208-94-228]_02",
      "attachments": [
        {
          "name": "sample.demo.test1.txt",
          "content_type": "text/plain",
          "data": "dGhpcyBpcyBzYW1wbGUgdGVzdA=="
        },
        {
          "name": "sample.demo.test2.txt",
          "content_type": "text/plain",
          "data": "dGhpcyBpcyBzYW1wbGUgdGVzdA=="
        }
      ],
      "test_step_logs": [
        {
          "description": "demo b",
          "expected_result": "demo b",
          "actual_result": "demo b",
          "status": "FAILED",
          "order": 0
        },
        {
          "description": "demo c1",
          "expected_result": "demo c1",
          "actual_result": "demo c1",
          "status": "SKIPPED",
          "order": 1
        },
        {
          "description": "demo c2",
          "expected_result": "demo c2",
          "actual_result": "demo c2",
          "status": "PASSED",
          "order": 2
        },
        {
          "description": "demo a",
          "expected_result": "demo a",
          "actual_result": "demo a",
          "status": "PASSED",
          "order": 3
        }
      ]
    }
  ]
}

Response body

Key Description
id Id of the submission job. You will need this Id to check the job status using this API
state Status of the job. Its value includes IN_WAITING, IN_PROCESSING, FAILED, PENDING, and SUCCESS

Response sample:

{
    "id": 11254,
    "type": "AUTOMATION_TEST_LOG",
    "state": "IN_WAITING"
}
Subscribe To Our Blog
Powered by Zendesk