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 |
---|---|---|---|---|---|
start | body | no | Start index of records | - | integer |
limit | body | no | Number of records per page | - | integer |
page | body | no | Page number to be displayed | - | integer |
tsFolderID | body | yes | FolderId of Test Suites | - | integer |
scope | body | yes | Scope of Testsuite, possible values project,release,cycle | - | string |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | Testsuite list fetch successfully | ResponseEntity |
400 | Invalid json object or mandatory fields missing | - |
401 | Unauthorised or session expired | - |
500 | Returned 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 |
---|---|---|---|---|---|
tsID | body | yes | ID of Testsuite whose Testsuite Runs are to be obtained | - | string |
start | body | no | Start index of records | - | integer |
limit | body | no | Number of records per page | - | integer |
page | body | no | Page number to be displayed | - | integer |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | Successfully fetched Testcase Runs | ResponseEntity |
400 | Invalid json object or mandatory fields missing | - |
401 | Unauthorised or session expired | - |
500 | Returned 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 |
---|---|---|---|---|---|
tsrID | body | yes | ID of Testsuite Run whose Testcase Runs are to be obtained | - | string |
start | body | yes | Start index of records | - | integer |
limit | body | yes | Number of records per page | - | integer |
page | body | yes | Page number to be displayed | - | integer |
filter | body | yes | Add filter to get filtered Testcase Runs | - | Array[Filter] |
showTcWithDefects | body | no | True to get only those Testcase Runs which have Defects linked with them | - | boolean |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
---|---|---|
200 | Successfully fetched Testcase Runs | ResponseEntity |
400 | Invalid json object or mandatory fields missing | - |
401 | Unauthorised or session expired | - |
500 | Returned when server connection times out | - |
ResponseEntity
name | type | required | description | example |
---|---|---|---|---|
headers | object | optional | - | |
body | object | optional | - | |
statusCode | string | optional | - |
Filter
name | type | required | description | example |
---|---|---|---|---|
value | object | optional | - | |
comparison | string | optional | - | |
type | string | optional | - | |
field | string | optional | - |
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.