How to get the execution status of Test cases linked to a Testsuite via REST API? (4) (4)

Refer a Complete help documentation of Open Rest APIs.

To get the execution status of test cases linked to a test suite via rest api please follow below steps.


Step 1 : First get the list of Test suites. 

API Name : Get List of Testsuites, 

Input: tsFolderID, 

Output: tsID, entity key 

POST /rest/testsuites/list

Request

Content-Type: application/json

Parameters

Name
Located in
Required
Description
Default
Schema
startbodynoStart index of records-integer
limitbodynoNumber of records per page-integer
pagebodynoPage number to be displayed-integer
tsFolderIDbodyyesFolderId of Test Suites-integer
scopebodyyesScope of Testsuite, possible values project,release,cycle-string

Response

Content-Type: application/json

Status CodeReasonResponse Model
200Testsuite list fetch successfullyResponseEntity
400Invalid json object or mandatory fields missing-
401Unauthorised or session expired-
500Returned when server connection times out-

Step 2 : Get the list of all Test Executions (tsrID) associated to a Test Suite (tsID)  

API Name: Get Testsuite Run Ids, 

Input:tsID (Testsuite Id), 

Output: tsRunID (Testsuite Run Id) for a combination of Platform, Release Name and Cycle Name

POST /rest/execution/list/platformHome

Description

Find the number of executions of a test suite.

Request

Content-Type: application/json

Parameters

Name
Located in
Required
Description
Default
Schema
tsIDbodyyesID of Testsuite whose Testsuite Runs are to be obtained-string
startbodynoStart index of records-integer
limitbodynoNumber of records per page-integer
pagebodynoPage number to be displayed-integer

Response

Content-Type: application/json

Status CodeReasonResponse Model
200Successfully fetched Testcase RunsResponseEntity
400Invalid json object or mandatory fields missing-
401Unauthorised or session expired-
500Returned when server connection times out-

Step 3 : Get the list of Test Cases and Execution Result for a Test Execution 

API Name: Get Testcase Run Id's, 

Input: tsrID (Obtained from Step 2), 

Output: StatusNameText (Execution Status), Testcase Details (Testcase ID, Entity Key, Name), Defects (Internal Key & Jira Key)

POST /rest/execution/list/tcr

Description

APIs for Test Executions

Request

Content-Type: application/json

Parameters

Name
Located in
Required
Description
Default
Schema
tsrIDbodyyesID of Testsuite Run whose Testcase Runs are to be obtained-string
startbodyyesStart index of records-integer
limitbodyyesNumber of records per page-integer
pagebodyyesPage number to be displayed-integer
filterbodyyesAdd filter to get filtered Testcase Runs-Array[Filter]
showTcWithDefectsbodynoTrue to get only those Testcase Runs which have Defects linked with them-boolean

Response

Content-Type: application/json

Status CodeReasonResponse Model
200Successfully fetched Testcase RunsResponseEntity
400Invalid json object or mandatory fields missing-
401Unauthorised or session expired-
500Returned when server connection times out-
ResponseEntity
nametyperequireddescriptionexample
headersobjectoptional-
bodyobjectoptional-
statusCodestringoptional-
Filter
name
type
required
description
example
valueobjectoptional-
comparisonstringoptional-
typestringoptional-
fieldstringoptional-

Note: For quick reference attached a (TestSuite Collection.postman_collection.json) postman collection of these API's. Import them to postman & reuse them replacing with your URL, API Key, Testsuite folder ids, TestSuite Ids. Collection has 3 API's as of above Step Names & description that has the input and output parameters.