Menu

Test Run APIs

Revision table

#Release DateAPINew or UpdateDescription of Change
1 03/28/2016

Submit An Automation Test Log

Update API submitters are able to specify Test Steps' order in the request body
2 03/28/2016

Get A Test Run By Its ID

Get All Test Runs Under Root

Get All Test Runs Under A Specific Release

Get All Test Runs Under A Specific Test Cycle

Get All Test Runs Under A Specific Test Suite

Update test_case_version_id is added in response body
3 03/28/2016

Get the latest Test Log of a Test Run

Update actual_exe_time is added in response body
4 03/28/2016

Create A Test Run Under Root

Create A Test Run Under A Specific Release

Create A Test Run Under A Specific Test Cycle

Create A Test Run Under A Specific Test Suite

Update Use test_case_version_id attribute in the request body to create a Test Run from a specific Test Case version
5 03/28/2016

Update A Test Run Or Move It To Other Container

Update Use test_case_version_id attribute in the request body to update Test Case version of a Test Run
6 05/23/2016

Get all Test Logs of a Test Run

New  
7 09/23/2016

Batch Submit Test Logs of multiple Test Runs

New  
8 09/23/2016

Check Status of the Batch Test Log Submission job

New  
9 09/29/2016

Submit An Automation Test Log

Update Support submitting Test Log with Notes in HTML format using parameter encodeNote
10 19/12/2016

Get A Test Run By Its ID

Get All Test Runs Under Root

Get All Test Runs Under A Specific Release

Get All Test Runs Under A Specific Test Cycle

Get All Test Runs Under A Specific Test Suite

Update Test Case creator is added in response body
11 01/16/2017

Submit A Test Log

Update Support submitting Test Log with called Test Case

Contents

Get All Test Run Fields

List test run execution status values

Get A Test Run By Its ID

Get All Test Runs Under Root

Get All Test Runs Under A Specific Release

Get All Test Runs Under A Specific Test Cycle

Get All Test Runs Under A Specific Test Suite

Get All Test Runs Under A Specific Test Suite - Deprecated

Get the latest Test Log of a Test Run

Get all Test Logs of a Test Run

Create A Test Run Under Root

Create A Test Run Under A Specific Release

Create A Test Run Under A Specific Test Cycle

Create A Test Run Under A Specific Test Suite

Update A Test Run Or Move It To Other Container

Delete A Test Run

Submit A Test Log

Submit An Automation Test Log

Batch Submit Test Logs of multiple Test Runs

Check Status of the Batch Test Log Submission job

Get All Test Run Fields

GET /api/v3/projects/{projectId}/settings/test-runs/fields

qTest version: 4+

Description: To get all active Test Run's fields.

Path variable:

  • projectId: ID of the project

Request sample:

GET /api/v3/projects/14921/settings/test-runs/fields HTTP/1.1
Host: nephele.qtestnet.com
Content-Type: application/json
Authorization: --
Cache-Control: no-cache

Response sample:

[
    {
        "links": [
            {
                "rel": "self",
                "href": "https://nephele.qtestnet.com/api/v3/projects/14921/608916"
            }
        ],
        "id": 608916,
        "attribute_type": "Number",
        "label": "Execution Type",
        "required": false,
        "constrained": true,
        "order": 1,
        "allowed_values": [
            {
                "links": [],
                "value": 501,
                "label": "Functional",
                "order": 1,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 502,
                "label": "Regression",
                "order": 2,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 503,
                "label": "Smoke",
                "order": 3,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 504,
                "label": "Sanity",
                "order": 4,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 505,
                "label": "Usability",
                "order": 5,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 506,
                "label": "Install/Uninstall",
                "order": 6,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 507,
                "label": "Non Functional",
                "order": 7,
                "is_default": false,
                "is_active": true
            }
        ],
        "multiple": false,
        "data_type": 13,
        "searchable": false,
        "free_text_search": false,
        "search_key": "type",
        "system_field": true,
        "original_name": "ExecutionTypeTestRun",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://nephele.qtestnet.com/api/v3/projects/14921/608917"
            }
        ],
        "id": 608917,
        "attribute_type": "Date",
        "label": "Planned Start Date",
        "required": false,
        "constrained": false,
        "order": 2,
        "multiple": false,
        "data_type": 13,
        "searchable": false,
        "free_text_search": false,
        "system_field": true,
        "original_name": "PlannedStartTestRun",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://nephele.qtestnet.com/api/v3/projects/14921/608918"
            }
        ],
        "id": 608918,
        "attribute_type": "Number",
        "label": "Environment",
        "required": false,
        "constrained": true,
        "order": 3,
        "allowed_values": [],
        "multiple": false,
        "data_type": 13,
        "searchable": false,
        "free_text_search": false,
        "system_field": true,
        "original_name": "EnvironmentTestRun",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://nephele.qtestnet.com/api/v3/projects/14921/608919"
            }
        ],
        "id": 608919,
        "attribute_type": "Date",
        "label": "Planned End Date",
        "required": false,
        "constrained": false,
        "order": 4,
        "multiple": false,
        "data_type": 13,
        "searchable": false,
        "free_text_search": false,
        "system_field": true,
        "original_name": "PlannedEndTestRun",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://nephele.qtestnet.com/api/v3/projects/14921/608912"
            }
        ],
        "id": 608912,
        "attribute_type": "Number",
        "label": "Assigned To",
        "required": false,
        "constrained": true,
        "order": 7,
        "allowed_values": [
            {
                "links": [],
                "value": 3754,
                "label": "Duong Pham",
                "order": 1,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 5500,
                "label": "Nephele Pro",
                "order": 2,
                "is_default": false,
                "is_active": true
            }
        ],
        "multiple": false,
        "data_type": 13,
        "searchable": false,
        "free_text_search": false,
        "system_field": true,
        "original_name": "AssignedToTestRun",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://nephele.qtestnet.com/api/v3/projects/14921/608923"
            }
        ],
        "id": 608923,
        "attribute_type": "Number",
        "label": "Priority",
        "required": false,
        "constrained": true,
        "order": 10,
        "allowed_values": [
            {
                "links": [],
                "value": 721,
                "label": "Undecided",
                "order": 1,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 722,
                "label": "Low",
                "order": 2,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 723,
                "label": "Medium",
                "order": 3,
                "is_default": true,
                "is_active": true
            },
            {
                "links": [],
                "value": 724,
                "label": "High",
                "order": 4,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 725,
                "label": "Urgent",
                "order": 5,
                "is_default": false,
                "is_active": true
            }
        ],
        "multiple": false,
        "data_type": 13,
        "searchable": false,
        "free_text_search": false,
        "search_key": "prt",
        "system_field": true,
        "original_name": "PriorityTestRun",
        "is_active": true
    }
]

List test run execution status values

GET /api/v3/projects/{projectId}/test-runs/execution-statuses

qTest version: 4+

Description: To get all execution status values for Test Run/Test Step of a specific project.

Path variable:

  • projectId: ID of the project

Request sample:

 GET /api/v3/projects/1/test-runs/execution-statuses  
 Host: nephele.qtestnet.com  
 Authorization: --  
 Cache-Control: no-cache  

Response sample:

 HTTP/1.1 200  OK  
 Cache-Control: no-cache  
 Content-Type: application/json;charset=UTF-8  
 Date: Tue, 25 Mar 2014 03:07:25 GMT  
 Expires: Thu, 01 Jan 1970 00:00:00 GMT  
 Pragma: no-cache  
 Server: Apache-Coyote/1.1  
 Transfer-Encoding: chunked  
 [  
   {  
     "links": [],  
     "id": 601,  
     "name": "Passed",  
 "color": "#8fbc8f",  
     "is_default": true  
   },  
   {  
     "links": [],  
     "id": 602,  
     "name": "Failed",  
 "color": "#f08080",  
     "is_default": false  
   },  
   {  
     "links": [],  
     "id": 603,  
     "name": "Incomplete",  
 "color": "#ffff00",  
     "is_default": false  
   },  
   {  
     "links": [],  
     "id": 604,  
     "name": "Blocked",  
 "color": "#ffff00",  
     "is_default": false  
   },  
   {  
     "links": [],  
     "id": 605,  
     "name": "Unexecuted",  
 "color": "#e5e5e5",  
     "is_default": false  
   }  
 ]  

Get A Test Run By Its ID

GET /api/v3/projects/{projectId}/test-runs/{testRunId}

qTest version: 4+

Description: To retrieve a Test Run. You can optionally retrieve the associated Test Case and its Test Steps.

Path variable:

  • projectId: ID of the project
  • testRunID: ID of the test run

Request parameter: use parameter expand and specify the following valid values

  • testcase: expand the associated test case in the response
  • testcase.teststep: expand the associated test case and its test steps in the response

Request sample:

GET /api/v3/projects/32029/test-runs/7362576 HTTP/1.1
Host: linhdang.qtestnet.com
Authorization: bearer [token]
Cache-Control: no-cache

Response sample:

{
    "links": [
        {
            "rel": "test-case",
            "href": "https://linhdang.qtestnet.com/api/v3/projects/32029/test-cases/5574277?versionId=6573928"
        },
        {
            "rel": "self",
            "href": "https://linhdang.qtestnet.com/api/v3/projects/32029/test-runs/7362576"
        }
    ],
    "id": 7362576,
    "name": "Call another",
    "pid": "TR-44",
    "properties": [
        {
            "field_id": -48,
            "field_value": "0"
        },
        {
            "field_id": -33,
            "field_value": "0"
        },
        {
            "field_id": -39,
            "field_value": "0"
        },
        {
            "field_id": -59,
            "field_value": "4"
        },
        {
            "field_id": -36,
            "field_value": "1"
        },
        {
            "field_id": 1695378,
            "field_value": "505"
        },
        {
            "field_id": 1695379,
            "field_value": "2016-11-30T17:00:00+00:00"
        },
        {
            "field_id": 1695380
        },
        {
            "field_id": 1695381,
            "field_value": "2016-11-30T17:00:00+00:00"
        },
        {
            "field_id": 1695374,
            "field_value": "5202"
        },
        {
            "field_id": 1695387,
            "field_value": "601"
        },
        {
            "field_id": 1695385,
            "field_value": "723"
        }
    ],
    "test_case_version_id": 6573928,
    "creator_id": 5202
} 

Get All Test Runs Under Root

GET /api/v3/projects/{projectId}/test-runs

GET /api/v3/projects/{projectId}/test-runs?parentId=0&parentType=root

qTest version: 6+

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
parentId no Input 0 (zero) to get Test Runs directly under root.
parentType no Input root to get Test Runs directly under root.

Get All Test Runs Under A Specific Release

GET /api/v3/projects/{projectId}/test-runs?parentId={releaseId}&parentType=release

qTest version: 6+

Description: To retrieve all test runs under a specific release. The ID of the release is specified in the request parameter.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
parentId yes Specify the release ID.
parentType yes Input release

Get All Test Runs Under A Specific Test Cycle

GET /api/v3/projects/{projectId}/test-runs?parentId={parentCycleId}&parentType=test-cycle

qTest version: 6+

Description: To retrieve all test runs under a specific parent test cycle. The ID of the parent test cycle is specified in the request parameter.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
parentId yes Specify the parent test cycle ID.
parentType yes Input test-cycle

Get All Test Runs Under A Specific Test Suite

GET /api/v3/projects/{projectId}/test-runs?parentId={parentSuiteId}&parentType=test-suite

qTest version: 6+

Description: To retrieve all test runs under a specific parent test suite. The ID of the parent test suite is specified in the request parameter.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
parentId yes Specify the test suite ID.
parentType yes Input test-suite

Request sample:

GET /api/v3/projects/32029/test-runs/7362576?parentId=481322&parentType=test-suite HTTP/1.1
Host: linhdang.qtestnet.com
Authorization: bearer [token]
Cache-Control: no-cache

Response sample:

{
    "links": [
        {
            "rel": "test-case",
            "href": "https://linhdang.qtestnet.com/api/v3/projects/32029/test-cases/5574277?versionId=6573928"
        },
        {
            "rel": "self",
            "href": "https://linhdang.qtestnet.com/api/v3/projects/32029/test-runs/7362576"
        }
    ],
    "id": 7362576,
    "name": "Call another",
    "pid": "TR-44",
    "properties": [
        {
            "field_id": -48,
            "field_value": "0"
        },
        {
            "field_id": -33,
            "field_value": "0"
        },
        {
            "field_id": -39,
            "field_value": "0"
        },
        {
            "field_id": -59,
            "field_value": "4"
        },
        {
            "field_id": -36,
            "field_value": "1"
        },
        {
            "field_id": 1695378,
            "field_value": "505"
        },
        {
            "field_id": 1695379,
            "field_value": "2016-11-30T17:00:00+00:00"
        },
        {
            "field_id": 1695380
        },
        {
            "field_id": 1695381,
            "field_value": "2016-11-30T17:00:00+00:00"
        },
        {
            "field_id": 1695374,
            "field_value": "5202"
        },
        {
            "field_id": 1695387,
            "field_value": "601"
        },
        {
            "field_id": 1695385,
            "field_value": "723"
        }
    ],
    "test_case_version_id": 6573928,
    "creator_id": 5202
}

Get All Test Runs Under A Specific Test Suite - Deprecated

GET /api/v3/projects/{projectId}/test-suites/{testSuiteId}/test-runs

qTest version: Deprecated from version 6

Description: To get all test runs in a test suite.

Path variable:

  • projectId: ID of the project
  • testsuiteId: ID of the test suite

Request sample:

 GET /api/v3/projects/1/test-suites/24/test-runs  
 Host: nephele.qtestnet.com  
 Authorization: bmVwaGVsZXxtYXhtY2Nsb3VkQHFhc3ltcGhvbnkuY29tOjEzOTU4MDE3MjAwODQ6NjZjNGY4MGVjYjA0NWRjZGRhMDVkMzQwYTdjZTU5NmU  
 Cache-Control: no-cache  

Response sample:

 HTTP/1.1 200  OK  
 Cache-Control: no-cache  
 Content-Type: application/json;charset=UTF-8  
 Date: Tue, 25 Mar 2014 03:57:10 GMT  
 Expires: Thu, 01 Jan 1970 00:00:00 GMT  
 Pragma: no-cache  
 Server: Apache-Coyote/1.1  
 Transfer-Encoding: chunked  
 [  
   {  
     "links": [  
       {  
         "rel": "self",  
         "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-runs/192"  
       }  
     ],  
     "id": 192,  
     "name": "TC-Add a Comment to Event "  
   },  
   {  
     "links": [  
       {  
         "rel": "self",  
         "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-runs/193"  
       }  
     ],  
     "id": 193,  
     "name": "TC-Add a new contact"  
   },  
   {  
     "links": [  
       {  
         "rel": "self",  
         "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-runs/194"  
       }  
     ],  
     "id": 194,  
     "name": "TC-Add an existing contact"  
   }  
 ]  

Get the latest Test Log of a Test Run

GET /api/v3/projects/{projectId}/test-runs/{testRunId}/test-logs/last-run?expand={testcase, teststeplog.teststep}

qTest version: 4+

Description: To get the Test Run's latest execution result.

Path variable:

  • projectId: ID of the project
  • testRunID: ID of the test run

Request parameter: use parameter expand and specify the following valid values

  • testcase: expand the associated test case and the test step logs in the response
  • teststeplog.teststep: expand test step logs in the response

Request sample:

 GET /api/v3/projects/1/test-runs/192/test-logs/last-run  
 Host: nephele.qtestnet.com  
 Authorization: --  
 Cache-Control: no-cache  

Response sample:

 {  
   "links": [  
     {  
       "rel": "self",  
       "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-runs/192/test-logs/1881"  
     },  
     {  
       "rel": "test-case",  
       "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-cases/381/versionversions/2336"  
     },  
     {  
       "rel": "test-steps",  
       "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-runs/192/test-logs/1881/test-steps"  
     },  
     {  
       "rel": "attachments",  
       "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-logs/1881/attachments"  
     }  
   ],  
   "status": {  
     "id": 603,  
     "name": "Incomplete",  
     "is_default": false  
   },  
   "attachments": [  
     {  
       "links": [  
         {  
           "rel": "self",  
           "href": "http://nephele.qtestnet.com/api/v3/projects/1/1881/attachments/325"  
         }  
       ],  
       "name": "sprite.png",  
       "id": 325,  
       "content_type": "image/png"  
     }  
   ],  
   "test_case_version_id": 2336,  
   "user_id": 2,  
   "test_step_logs": [  
     {  
       "links": [  
         {  
           "rel": "self",  
           "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-runs/192/test-logs/1881/test-steps/12292"  
         },  
         {  
           "rel": "test-step",  
           "href": "http://nephele.qtestnet.com/api/v3/projects/1/test-cases/381/test-steps/16271"  
         },  
         {  
           "rel": "defects",  
           "href": "http://nephele.qtestnet.comapi/v3/projects/1/test-runs/192/test-logs/1881/test-steps/12292/defects"  
         }  
       ],  
       "status": {  
         "id": 601,  
         "name": "Passed",  
         "is_default": false  
       },  
       "group": 0,  
       "test_step_id": 16271,  
       "user_id": 2,  
       "actual_result": "",  
       "run_order": 1  
     }  
   ]  
 }  

Get all Test Logs of a Test Run

GET /api/v3/projects/{projectId}/test-runs/{testrunId}/test-logs

qTest version: 7.6+

Description: To retrieve all Test Logs of a Test Run

Path variable:

  • projectId: ID of the project
  • testRunID: ID of the test run

Request Parameter:

Parameter Required Description
pageSize no The result is paginated. By the default, the number of objects in each page is 100. You can specify your custom number in this parameter. The maximum page size is 1000.
page no By default the first page is returned. However, you can specify any page number to retrieve objects.

Request sample:

GET /api/v3/projects/5582/test-runs/723678/test-logs?page=1&pageSize=1 HTTP/1.1
Host: nephele.qtestnet.com
Authorization: ---

Response sample:

{
  "links": [
    {
      "rel": "next",
      "href": "https://nephele.qtestnet.com/api/v3/projects/5582/test-runs/723678/test-logs?page=2&pageSize=1"
    }
  ],
  "page": 1,
  "page_size": 1,
  "total": 5,
  "items": [
    {
      "links": [
        {
          "rel": "self",
          "href": "https://nephele.qtestnet.com/api/v3/projects/5582/test-runs/723678/test-logs/2705306"
        },
        {
          "rel": "test-case",
          "href": "https://nephele.qtestnet.com/api/v3/projects/5582/test-cases/444309?versionId=609457"
        },
        {
          "rel": "attachments",
          "href": "https://nephele.qtestnet.com/api/v3/projects/5582/test-logs/2705306/attachments"
        }
      ],
      "id": 2705306,
      "test_case_version_id": 609457,
      "exe_start_date": "2016-05-26T10:46:58+07:00",
      "exe_end_date": "2016-05-26T10:47:27+07:00",
      "user_id": 18476,
      "planned_exe_time": 30,
      "actual_exe_time": 60,
      "status": {
        "links": [],
        "id": 601,
        "name": "Passed"
      },
      "result_number": 5
    }
  ]
}

Create A Test Run Under Root

POST /api/v3/projects/{projectId}/test-runs

POST /api/v3/projects/{projectId}/test-runs?parentId=0&parentType=root

qTest version: 6+

Description: To create a new test run directly located under root. The associated test case is specified in the request body.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
parentId no Input 0 (zero) to create a test run directly under root.
parentType no Input root to create a test run directly under root.

Request sample:

POST /api/v3/projects/14921/test-runs HTTP/1.1
Host: nephele.qtestnet.com
Content-Type: application/json
Authorization: --
Cache-Control: no-cache

{ 
	"name": "TR001", 
	"test_case": 
	{ 
		"id": 1236996,
		"test_case_version_id": 1406104 //optionally specify a test case version
	} 
}

Response sample:

{
  "links": [
    {
      "rel": "test-case",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-cases/1236996?versionId=1406104"
    },
    {
      "rel": "self",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-runs/2431061"
    }
  ],
  "id": 2431061,
  "name": "TR001",
  "pid": "TR-1",
  "properties": [
    {
      "field_id": 608916,
      "field_value": "501"
    },
    {
      "field_id": 608917,
      "field_value": "2015-07-26T17:00:00+00:00"
    },
    {
      "field_id": 608918
    },
    {
      "field_id": 608919
    },
    {
      "field_id": 608912,
      "field_value": "3754"
    },
    {
      "field_id": 608923,
      "field_value": "723"
    }
  ]
}

Create A Test Run Under A Specific Release

POST /api/v3/projects/{projectId}/test-runs?parentId={releaseId}&parentType=release

qTest version: 6+

Description: To create a test run under a specific release. The ID of the release is specified in the request parameter. The associated test case is specified in the request body.

button-round-warning-icon.pngHINT: In the request body, you can only specify a valid target build under the specified release. If not, it will be skipped.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
parentId yes Specify the release ID.
parentType yes Input release

Request sample:

POST /api/v3/projects/14921/test-runs?parentId=61162&parentType=release HTTP/1.1
Host: nephele.qtestnet.com
Content-Type: application/json
Authorization: --
Cache-Control: no-cache

{
  "name": "TR002",
  "test_case": {
    "id": 1236996,
	"test_case_version_id": 1406104 //optionally specify a test case version
  }
}

Response sample:

{
  "links": [
    {
      "rel": "test-case",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-cases/1236996?versionId=1406104"
    },
    {
      "rel": "release",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/releases/61162"
    },
    {
      "rel": "self",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-runs/2431420"
    }
  ],
  "id": 2431420,
  "name": "TR002",
  "pid": "TR-2",
  "properties": [
    {
      "field_id": 608916,
      "field_value": "501"
    },
    {
      "field_id": 608917,
      "field_value": "2015-07-27T07:44:29+00:00"
    },
    {
      "field_id": 608918
    },
    {
      "field_id": 608919,
      "field_value": "2015-07-27T07:44:29+00:00"
    },
    {
      "field_id": 608912,
      "field_value": "3754"
    },
    {
      "field_id": 608923,
      "field_value": "723"
    }
  ]
}

Create A Test Run Under A Specific Test Cycle

POST /api/v3/projects/{projectId}/test-runs?parentId={testCycleId}&parentType=test-cycle

qTest version: 6+

Description: To create a test run under a specific test cycle. The ID of the parent test cycle is specified in the request parameter. The associated test case is specified in the request body.

button-round-warning-icon.pngHINT:

  • If the parent test cycle's target build has been set: In the request body, you can only specify the same target build with the parent test cycle. If not, it will be skipped.
  • If the parent test cycle's target release has been set and target build has not been set: In the request body, you can only specify a valid target build under the specified release. If not, it will be skipped.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
parentId yes Specify the parent test cycle ID.
parentType yes Input test-cycle

Request sample:

POST /api/v3/projects/14921/test-runs?parentId=125019&parentType=test-cycle HTTP/1.1
Host: nephele.qtestnet.com
Content-Type: application/json
Authorization: --
Cache-Control: no-cache

{
  "name": "TR003",
  "test_case": {
    "id": 1236996,
	"test_case_version_id": 1406104 //optionally specify a test case version
  }
}

Response sample:

{
  "links": [
    {
      "rel": "test-case",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-cases/1236996?versionId=1406104"
    },
    {
      "rel": "test-cycle",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-cycles/125019"
    },
    {
      "rel": "self",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-runs/2431500"
    }
  ],
  "id": 2431500,
  "name": "TR003",
  "pid": "TR-3",
  "properties": [
    {
      "field_id": 608916,
      "field_value": "501"
    },
    {
      "field_id": 608917,
      "field_value": "2015-07-26T17:00:00+00:00"
    },
    {
      "field_id": 608918
    },
    {
      "field_id": 608919
    },
    {
      "field_id": 608912,
      "field_value": "3754"
    },
    {
      "field_id": 608923,
      "field_value": "723"
    }
  ]
}

Create A Test Run Under A Specific Test Suite

POST /api/v3/projects/{projectId}/test-runs?parentId={testSuiteId}&parentType=test-suite

qTest version: 6+

button-round-warning-icon.pngHINT:

  • If the test suite's target build has been set: In the request body, you can only specify the same target build with the test suite. If not, it will be skipped.
  • If the test suite's target release has been set and target build has not been set: In the request body, you can only specify a valid target build under the specified release. If not, it will be skipped.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
parentId yes Specify the test suite ID.
parentType yes Input test-suite

Request sample:

POST /api/v3/projects/14921/test-runs?parentId=188721&parentType=test-suite HTTP/1.1
Host: nephele.qtestnet.com
Content-Type: application/json
Authorization: --
Cache-Control: no-cache

{
  "name": "TR004",
  "test_case": {
    "id": 1236996,
	"test_case_version_id": 1406104 //optionally specify a test case version
  }
}

Response sample:

{
  "links": [
    {
      "rel": "test-case",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-cases/1236996?versionId=1406104"
    },
    {
      "rel": "release",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/releases/61162"
    },
    {
      "rel": "test-suite",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-suites/188721"
    },
    {
      "rel": "self",
      "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-runs/2431751"
    }
  ],
  "id": 2431751,
  "name": "TR004",
  "pid": "TR-4",
  "properties": [
    {
      "field_id": 608916,
      "field_value": "501"
    },
    {
      "field_id": 608917,
      "field_value": "2015-07-27T07:44:29+00:00"
    },
    {
      "field_id": 608918
    },
    {
      "field_id": 608919,
      "field_value": "2015-07-27T07:44:29+00:00"
    },
    {
      "field_id": 608912,
      "field_value": "3754"
    },
    {
      "field_id": 608923,
      "field_value": "723"
    }
  ]
}

Update A Test Run Or Move It To Other Container

POST /api/v3/projects/{projectId}/test-runs/{testRunId}

qTest version: 6+

Description: To update an existing test run. You can utilize this API to move the test run to other container.

Path variable:

  • projectId: ID of the project
  • testRunId: ID of the test run which needs to be updated

Request Parameter: use these parameters in case you want to move the test run to other container.

Important_icon.pngImportant: If you use the request parameters, the request body will be ignore. That means the test run is being moved but it will not be updated with the properties specify in the request body.

Parameter Required Description
parentId yes Input 0 (zero) to move the test run to under root.
Specify a release ID to move the test run to that release.
Specify a test cycle ID to move the test run to that test cycle.
Specify a test suite ID to move the test run to that test suite.
parentType yes Input root in case you are moving the test run to under root.
Input release in case you are moving the test run to under a release.
Input test-cycle in case you are moving the test run to under a test cycle.
Input test-suite in case you are moving the test run to under a test suite.

Request sample:

PUT /api/v3/projects/14921/test-runs/2431420?parentId=0&parentType=root HTTP/1.1
Host: nephele.qtestnet.com
Content-Type: application/json
Authorization: --
Cache-Control: no-cache
{
	"test_case_version_id": 723
}

Response sample:

{
    "links": [
        {
            "rel": "test-case",
            "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-cases/1236996?versionId=1406104"
        },
        {
            "rel": "self",
            "href": "https://nephele.qtestnet.com/api/v3/projects/14921/test-runs/2431420"
        }
    ],
    "id": 2431420,
    "name": "TR002",
    "pid": "TR-2",
    "properties": [
        {
            "field_id": 608916,
            "field_value": "501"
        },
        {
            "field_id": 608917,
            "field_value": "2015-07-26T17:00:00+00:00"
        },
        {
            "field_id": 608918
        },
        {
            "field_id": 608919,
            "field_value": "2015-07-27T07:44:29+00:00"
        },
        {
            "field_id": 608912,
            "field_value": "3754"
        },
        {
            "field_id": 608923,
            "field_value": "723"
        }
    ]
}

Delete A Test Run

DELETE /api/v3/projects/{projectId}/test-runs/{testRunId}

qTest version: 6+

Description: To delete a test run

Path variable:

  • projectId: ID of the project
  • testRunId: ID of the test run which needs to be updated

Submit A Test Log

POST /api/v3/projects/{projectId}/test-runs/{testRunId}/test-logs

qTest version: 4+

Description: To submit the test execution result (test log) to qTest.

Path variable:

  • projectId: ID of the project
  • testRunId: ID of the test run

Request body:

Attribute Name Required Type Description
status true JSON Object Status, as in qTest project's Field Settings, of test log. Ex {“id”:602}
test_case_version_id false Number ID of the associated Test Case's version. If it is omitted, the submitted test log will be associated with the latest approved version of the Test Case
exe_start_date true DateTime Time when starting executing test run.
exe_end_date true DateTime Time when finishing executing test run.
attachments false JSONArray The JSONArray of the Attachment object.
test_step_logs false JSONArray The JSONArray of the TestStepLog object. In case a test step is calling another Test Case, parent_test_step_id is required
note false String Execution note included with the test log

Request sample:

POST /api/v3/projects/32029/test-runs/8816508/test-logs HTTP/1.1
Host: linhdang.qtestnet.com
Authorization: bearer --
Content-Type: application/json
Cache-Control: no-cache
{
  "exe_start_date": "2017-01-01T09:40:44+00:00",
  "exe_end_date": "2017-01-31T09:40:44+00:00",
  "test_case_version_id": 7620758,
  "status": {
    "id": 602
  },
  "test_step_logs": [
    {
      "test_step_id": 44431489,
      "status": {
        "id": 601
      }
    },
    {
      "test_step_id": 44431481,
      "parent_test_step_id": 44431490,
      "status": {
        "id": 601
      }
    },
    {
      "test_step_id": 44431482,
      "parent_test_step_id": 44431490,
      "status": {
        "id": 601
      }
    },
    {
      "test_step_id": 44431491,
      "status": {
        "id": 601
      }
    }
  ]
}

Response sample:

{
    "links": [
        {
            "rel": "self",
            "href": "https://linhdang.qtestnet.com/api/v3/projects/32029/test-runs/8816508/test-logs/6899529"
        },
        {
            "rel": "test-case",
            "href": "https://linhdang.qtestnet.com/api/v3/projects/32029/test-cases/6433915?versionId=7620758"
        },
        {
            "rel": "attachments",
            "href": "https://linhdang.qtestnet.com/api/v3/projects/32029/test-logs/6899529/attachments"
        }
    ],
    "id": 6899529,
    "test_case_version_id": 7620758,
    "exe_start_date": "2017-01-01T16:40:44+07:00",
    "exe_end_date": "2017-01-31T16:40:44+07:00",
    "user_id": 5202,
    "planned_exe_time": 0,
    "actual_exe_time": 43200,
    "status": {
        "links": [],
        "id": 602,
        "name": "Failed"
    },
    "result_number": 2
}

Submit An Automation Test Log

POST /api/v3/projects/{projectId}/test-runs/{testRunId}/auto-test-logs

qTest version: 4+

Description: To submit the automation result to qTest

  1. If the test run ID is greater than 0 (zero), eg: perform the execution using qTest export XML, qTest will update the result to the specific Test Run.
  2. If the test run ID is 0 (zero), eg: execute the automation without test suite/ test run pre-created on qTest, qTest will create new automation test run with name as the test run's name and result as submission's details. Its associated test case is also created with the same name.

Request parameter:

Parameter Required Description
suitePerDay false The acceptable values are either "true" or "false".
If it is true, the newly created Test Runs will locate under a Test Suite named under the execution date specified in parameter suiteDate, eg: Automation 2014-12-09. The execution date is specified in suiteDate, which is mentioned below.
If it is false, the newly created Test Runs will locate under Automation Test Suite.
In case you update an existing Test Run, its Test Suite remains unchanged.
suiteDate false It is required if suitePerDay is true. Its format is "yyyymmdd". The newly created Test Runs will locate under a Test Suite named "Automation yyyy-mm-dd", eg: Automation 2014-12-09.
encodeNote false Specify if the submitted Notes are in HTML format:
  • encodeNote=true: it's the default value. Notes are not in HTML format
  • encodeNote=false: Notes are in HTML format

Request body:

Attribute Name Required Type Description
status true String Use automation result values that were mapped at qTest automation settings
exe_start_date true DateTime Execution's starting time
exe_end_date true DateTime Execution's ending time
name true String Name of the Test Run or Test Case
automation_content true String An XML formatted string that contains the class test/ group test/ package test.
attachments false JSONArray The JSONArray of the Attachment object.
note false String Execution note included in the test log.
test_case_version_id false Number ID of the associated Test Case's version. In case the Test Run has not existed, this field should not be included or it will cause an error.
test_step_logs false JSONArray The JSONArray of the TestStepLog object.

Request sample:

 POST /api/v3/projects/1/test-runs/0/auto-test-logs?suitePerDay=true&suiteDate=20150102  HTTP/1.1  
 Host: nephele.banmuasam.com  
 Authorization: --
 Content-Type: application/json  
 Cache-Control: no-cache  
{
  "name":"sample.demo.api.AutomationTestLog",   
  "automation_content": "sample-demo-api-AutomationTestLog",   
  "status": "skip",
  "exe_start_date": "2014-03-29T02:09:11+06:00",   
  "exe_end_date": "2014-03-29T02:20:11+06:00",   
  "note": "your message note" ,   
  "attachments": [{
    "name": "sample_file_name.txt",   
    "content_type":"text/plain",   
    "data":"dGhpcyBpcyBzYW1wbGUgdGVzdA==" 
  }],
  "test_case_version_id":52,
  "test_step_logs":[{
    "description": "step 1 desc",
    "expected_result": "step 1 expected",
    "actual_result": "it is not meet requirement",
    "status": "fail"
  },{
    "description": "step 2 desc",
    "expected_result": "step 2 expected",
    "actual_result": "it meets requirement",
    "status": "skip"
  }]
} 

  IMPORTANT: Update for Armstrong release (March 28th, 2016)

  • 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. Ex
     POST /api/v3/projects/1/test-runs/0/auto-test-logs?suitePerDay=true&suiteDate=20150102  HTTP/1.1  
    		 Host: nephele.banmuasam.com  
    		 Authorization: --
    		 Content-Type: application/json  
    		 Cache-Control: no-cache  
    		{
    		  "name":"sample.demo.api.AutomationTestLog",   
    		  "automation_content": "sample-demo-api-AutomationTestLog",   
    		  "status": "skip",
    		  "exe_start_date": "2014-03-29T02:09:11+06:00",   
    		  "exe_end_date": "2014-03-29T02:20:11+06:00",   
    		  "note": "your message note" ,   
    		  "attachments": [{
    			"name": "sample_file_name.txt",   
    			"content_type":"text/plain",   
    			"data":"dGhpcyBpcyBzYW1wbGUgdGVzdA==" 
    		  }],
    		  "test_case_version_id":52,
    		  "test_step_logs":[{
    			"description": "step 1 desc",
    			"expected_result": "step 1 expected",
    			"actual_result": "it is not meet requirement",
    			"status": "fail",
    			"order": 0
    		  },{
    			"description": "step 2 desc",
    			"expected_result": "step 2 expected",
    			"actual_result": "it meets requirement",
    			"status": "skip",
    			"order": 1
    		  }]
    		} 
    		
  • If the order is omitted, Test Steps will be alphabetically sorted when creating or updating Test Case

Response sample:

 {  
   "links": [  
      {  
           "rel": "self",  
           "href": "http://nephele.banmuasam.com/ai/v3/projects/1/test-runs/689575/test-logs/371181"  
      },  
      {  :
           "rel": "test-case",  
           "href": "http://nephele.banmuasam.com/api/v3/projects/1/test-cases/527512/versions/585136  
      },  
      {  
           "rel": "attachments",  
           "href": "http://nephele.banmuasam.com/api/v3/projects/1/test-logs/371181/attachments"  
      }  
      ],  
      "id": 371181,  
      "test_case_version_id": 585136,  
      "user_id": 3754  
 }  

Batch Submit Test Logs of multiple Test Runs

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

qTest version: 8.0.2+

Description: To submit test logs of multiple test runs

Path variable:

  • projectId: ID of the project

Request body:

Attribute NameRequiredTypeDescription
test_suite No Number ID of the Test Suite where the submitted Test Runs will be located
parent_module No Number In case there has been no Test Case associated with the submitted Test Run, a new automation Test Case will be created. The new Test Cases are located under a module named Automation. If you specify an ID for parent_module, the Automation module will be located under the specified module. Otherwise, the Automation module is located directly under root
execution_date Yes String Execution date in YYYY-mm-dd format
test_logs Yes JSONArray The array of TestLog objects. The below are TestLog attributes.
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
name Yes String Test Run name
automation_content Yes String An XML formatted string that contains the class test/ group test/ package test
attachments No JSONArray An array of the Attachment objects
note No String Test Log note
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

Request sample:

POST /api/v3.1/projects/29666/test-runs/0/auto-test-logs?type=automation HTTP/1.1
Host: elite.qtestnet.com
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache

{
  "test_suite": "394700",
  "parent_module": "1412911",
  "execution_date": "2016-09-22",
  "test_logs": [
    {
      "status": "skip",
      "exe_start_date": "2016-10-15T05:00:00Z",
      "exe_end_date": "2016-10-16T05:00:00Z",
      "name": "sample.demo.test1",
      "automation_content": "sample.demo.test1",
      "attachments": [
            {
              "name": "sample_file_name2.txt",
              "content_type": "text/plain",
              "data": "dGhpcyBpcyBzYW1wbGUgdGVzdA=="
            }
          ],
      "test_step_logs": [
        {
          "description": "demo a",
          "expected_result": "demo a",
          "actual_result": "demo c",
          "order": 0,
          "status": "skip"
        }
      ]
    },
    {
      "status": "fail",
      "exe_start_date": "2016-10-15T05:00:00Z",
      "exe_end_date": "2016-10-16T05:00:00Z",
      "name": "sample.demo.test2",
      "automation_content": "sample.demo.test2",
      "attachments": [
            {
              "name": "sample_file_name2.txt",
              "content_type": "text/plain",
              "data": "dGhpcyBpcyBzYW1wbGUgdGVzdA=="
            }
          ],
      "test_step_logs": [
        {
          "description": "demo a1",
          "expected_result": "demo a1",
          "actual_result": "demo a1",
          "order": 0,
          "status": "fail"
        },
        {
          "description": "demo b1",
          "expected_result": "demo b1",
          "actual_result": "demo b1",
          "order": 1,
          "status": "pass"
        }
      ]
    }
  ]
}

Response body:

KeyDescription
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"
}

Check Status of the Batch Test Log Submission job

GET /api/v3/projects/queue-processing/{jobId}

qTest version: 8.0.2+

Description: To check the status of batch Test Log submission job

Path variable:

  • jobId: ID of the job. You can find the Id in Response body when you submit the job

Request sample:

GET /api/v3/projects/queue-processing/11199 HTTP/1.1
Host: elite.qtestnet.com
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache

Response body:

KeyDescription
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
content Addition info such as error message, the number of submitted Test Logs

Response sample:

{
  "id": 11254,
  "type": "AUTOMATION_TEST_LOG",
  "state": "SUCCESS",
  "contentType": "application/json",
  "content": "{"testSuiteName":"eggPlant 2016-07-13","testSuiteId":364987,"totalTestCases":2,"totalTestRuns":2,"totalTestLogs":2,"testLogs":[{"testLogId":4196388,"automationContent":"sample.demo.test1"},{"testLogId":4196389,"automationContent":"sample.demo.test2"}]}"
}
Subscribe To Our Blog
Powered by Zendesk