Test Log APIs

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 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 a 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 Test Log objects. The below are Test Log attributes.

Test Log 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 array of Test Step Log objects. You can specify Test Steps order in the request. It must be continuous 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 continuous 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
This API does not update names and locations of existing Test Cases and Test Runs

Request Sample:

Response Body:

Key Description
id Id of the submission job. You will need this Id to check the job status.
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"
}