- Testsigma REST APIs
Manage Environments
Elements
Test Plans
Upload Files
Get Project Wide Information
Upload & Update Test Data Profile
Fetch Test Results (All Levels)
Trigger Multiple Test Plans
Trigger Test Plans Remotely & Wait Until Completion
Run the Same Test Plan Multiple Times in Parallel
Schedule, Update & Delete a Test Plan Using API
Update Test Case Results Using API
Create and Update Values of Test Data Profile Using REST API
Rerun Test Cases from Run Results using API
Salesforce Metadata Refresh Using API
Manage Test Steps Using API
Fetch Test Results at all Levels Using APIs
You can leverage Testsigma APIs to fetch detailed test results at all levels. Whether you need results for an entire test plan, a specific test machine, a test suite, an individual test case, or even the test step level, Testsigma's APIs give you the necessary endpoints to get this data. This article discusses how to fetch these results in Testsigma.
Prerequisites
Before you begin, ensure that you have referred to:
- Documentationon generating API keys from Testsigma application.
- Documentation on getting test plan run ID from Testsigma application.
Fetch Test Plan Results
Index for Fetching Test Run Results:
URL:
https://app.testsigma.com/api/v2/test_runs/{run_id}TYPE: GET
TS_QUERY: <parameter><operator><value> chained with , (ex: query=testPlanId:1,result:PASSED)
Operators:
- : = EQUAL
- ! = NOT EQUAL
- > = GREATER THAN
- < = LESS THAN
- ~ = LIKE
- @ = IN
- ; = NOT IN
- $ = CONTAINS
STATUS: 200/401/500/400
Pagination: { page:
, pageSize: , isLast: , totalElements: }
| Request Type | GET |
|---|---|
| Endpoint | https://app.testsigma.com/api/v2/test_runs/{run_id} |
| Authorization | Bearer Token |
| Response Body Type | JSON |
| Response Body (Sample) | { "id": 517, "testPlanId": 420, "buildNo": "run69", "result": "FAILURE", "startTime": "2024-05-29T07:29:19Z", "endTime": "2024-05-29T07:33:17Z", "duration": 238000, "executor": "bharath.k@testsigma.com", "triggeredType": "MANUAL", "metrics": { "id": 162, "testPlanResultId": 517, "totalCount": 8, "failedCount": 4, "passedCount": 4, "stoppedCount": 0, "notExecutedCount": 0, "queuedCount": 0, "runningCount": 0, "consolidatedPlanTotalCount": 8, "consolidatedPlanFailedCount": 4, "consolidatedPlanPassedCount": 4, "consolidatedPlanStoppedCount": 0, "consolidatedPlanNotExecutedCount": 0, "consolidatedPlanQueuedCount": 0, "consolidatedPlanRunningCount": 0, "result": "FAILURE", "latestResult": "FAILURE", "duration": 226000, "consolidatedDuration": 226000 } } |
In the response body above, we fetched the test plan results with ID 517.
Fetch Test Machine Results
Index for Fetching Test Machine Results:
URL:
https://app.testsigma.com/api/v2/test_runs/{run_id}/test_machine_results/{machine_result_id}TYPE: GET
TS_QUERY: <parameter><operator><value> chained with , (ex: query=testPlanId:1,result:PASSED)
Operators:
- : = EQUAL
- ! = NOT EQUAL
- > = GREATER THAN
- < = LESS THAN
- ~ = LIKE
- @ = IN
- ; = NOT IN
- $ = CONTAINS
STATUS: 200/401/500/400
Pagination: { page:
, pageSize: , isLast: , totalElements: }
| Request Type | GET |
|---|---|
| Endpoint | https://app.testsigma.com/api/v2/test_runs/{run_id}/test_machine_results/{machine_result_id} |
| Authorization | Bearer Token |
| Response Body Type | JSON |
| Response Body (Sample) | { "id": 1434, "testRunId": 517, "result": "FAILURE", "startTime": "2024-05-29T07:29:19Z", "endTime": "2024-05-29T07:31:40Z", "duration": 141000, "deviceConfiguration": { "title": "Windows Chrome", "osVersion": "11", "browser": "GoogleChrome", "browserVersion": "123.0", "resolution": "1920x1080", "platform": "Windows", "deviceName": null, "hostName": "agent.testsigma.com", "osType": "WINDOWS" }, "metrics": { "id": 165, "testDeviceResultId": 1434, "testPlanResultId": 517, "totalCount": 4, "failedCount": 2, "passedCount": 2, "stoppedCount": 0, "notExecutedCount": 0, "queuedCount": 0, "runningCount": 0, "consolidatedTotalCount": 4, "consolidatedFailedCount": 2, "consolidatedPassedCount": 2, "consolidatedStoppedCount": 0, "consolidatedNotExecutedCount": 0, "consolidatedQueuedCount": 0, "consolidatedRunningCount": 0, "result": "FAILURE", "latestResult": "FAILURE", "duration": 129000, "consolidatedDuration": 129000 }, "appDetails": null } |
In the response body above, we fetched the test machine results with ID 1434.
Fetch Test Suite Results
Index for Fetching Test Suite Results:
URL:
https://app.testsigma.com/api/v2/test_runs/{run_id}/test_suite_results/{suite_id}TYPE: GET
TS_QUERY: <parameter><operator><value> chained with , (ex: query=testPlanId:1,result:PASSED)
Operators:
- : = EQUAL
- ! = NOT EQUAL
- > = GREATER THAN
- < = LESS THAN
- ~ = LIKE
- @ = IN
- ; = NOT IN
- $ = CONTAINS
STATUS: 200/401/500/400
Pagination: { page:
, pageSize: , isLast: , totalElements: }
| Request Type | GET |
|---|---|
| Endpoint | https://app.testsigma.com/api/v2/test_runs/{run_id}/test_suite_results/{suite_result_id} |
| Authorization | Bearer Token |
| Response Body Type | JSON |
| Response Body (Sample) | { "id": 1383, "testRunId": 517, "result": "FAILURE", "startTime": "2024-05-29T07:29:19Z", "endTime": "2024-05-29T07:30:33Z", "duration": 74000, "deviceConfiguration": null, "metrics": { "id": 293, "testDeviceResultId": 1434, "testPlanResultId": 517, "totalCount": 2, "failedCount": 1, "passedCount": 1, "stoppedCount": 0, "notExecutedCount": 0, "queuedCount": 0, "runningCount": 0, "consolidatedTotalCount": 2, "consolidatedFailedCount": 1, "consolidatedPassedCount": 1, "consolidatedStoppedCount": 0, "consolidatedNotExecutedCount": 0, "consolidatedQueuedCount": 0, "consolidatedRunningCount": 0, "result": "FAILURE", "latestResult": "FAILURE", "duration": 62000, "consolidatedDuration": 62000 }, "appDetails": null } |
In the response body above, we fetched the test suite results with ID 1383.
Fetch Test Case Results
Index for Fetching Test Case Results:
URL:
https://app.testsigma.com/api/v2/test_runs/{run_id}/test_case_results/{case_result_id}TYPE: GET
TS_QUERY: <parameter><operator><value> chained with , (ex: query=testPlanId:1,result:PASSED)
Operators:
- : = EQUAL
- ! = NOT EQUAL
- > = GREATER THAN
- < = LESS THAN
- ~ = LIKE
- @ = IN
- ; = NOT IN
- $ = CONTAINS
STATUS: 200/401/500/400
Pagination: { page:
, pageSize: , isLast: , totalElements: }
| Request Type | GET |
|---|---|
| Endpoint | https://app.testsigma.com/api/v2/test_runs/{run_id}/test_case_results/{case_result_id} |
| Authorization | Bearer Token |
| Response Body Type | JSON |
| Response Body (Sample) | { "id": 3857, "testCaseId": 609, "startTime": "2024-05-29T07:29:31Z", "endTime": "2024-05-29T07:29:55Z", "duration": 23038, "result": "FAILURE", "isDisabled": false, "isDataDriven": false, "metrics": { "id": 1089, "testCaseResultId": 3857, "testSuiteResultId": 1383, "testDeviceResultId": 1434, "testPlanResultId": 517, "totalCount": 6, "failedCount": 1, "passedCount": 3, "stoppedCount": 0, "notExecutedCount": 2, "queuedCount": 0, "skippedCount": 0, "runningCount": 0, "result": "FAILURE", "latestResult": "FAILURE", "duration": 23038, "consolidatedDuration": 23038 }, "appDetails": null } |
In the response body above, we fetched the test case results with ID 3857.
Fetch Test Step Results
| Request Type | GET |
|---|---|
| Endpoint | https://app.testsigma.com/api/v2/test_runs/{run_id}/test_case_results/{case_id}/step_results |
| Authorization | Bearer Token |
| Response Body Type | JSON |
| Response Body (Sample) | { "content": [ { "id": "3c51e933-7e15-41a0-893b-38e38b8258a2", "testMachineResultId": 1434, "testCaseResultId": 3857, "testCaseId": 609, "stepId": 2847, "type": "NLP_TEXT", "action": "Navigate to https://simply-travel.testsigma.com/", "message": "Successfully opened given URL.", "errorCode": null, "errorType": null, "result": "SUCCESS", "conditionalResult": null, "visualTestResult": null, "startTime": "2024-05-29T07:29:32Z", "endTime": "2024-05-29T07:29:33Z", "duration": 1133, "visualEnabled": false }, { "id": "c3a8fbeb-b508-41d2-83f7-6a0ca152e234", "testMachineResultId": 1434, "testCaseResultId": 3857, "testCaseId": 609, "stepId": 2848, "type": "NLP_TEXT", "action": "Click on Login or Sign Up Button", "message": "Successfully performed click action.", "errorCode": null, "errorType": null, "result": "SUCCESS", "conditionalResult": null, "visualTestResult": null, "startTime": "2024-05-29T07:29:37Z", "endTime": "2024-05-29T07:29:39Z", "duration": 2040, "visualEnabled": false }, { "id": "36bbdc50-ca05-4289-8342-c9e20d0491a4", "testMachineResultId": 1434, "testCaseResultId": 3857, "testCaseId": 609, "stepId": 2849, "type": "NLP_TEXT", "action": "Click on Login Button", "message": "Successfully performed click action.", "errorCode": null, "errorType": null, "result": "SUCCESS", "conditionalResult": null, "visualTestResult": null, "startTime": "2024-05-29T07:29:42Z", "endTime": "2024-05-29T07:29:44Z", "duration": 1539, "visualEnabled": false }, { "id": "abefa297-cb14-48f4-b9e8-60db12854c03", "testMachineResultId": 1434, "testCaseResultId": 3857, "testCaseId": 609, "stepId": 2850, "type": "NLP_TEXT", "action": "Select the radio button Mobile Number Radio Button", "message": "Unable to perform click/check action on element, Element is not displayed.", "errorCode": 1000001, "errorType": "ASSERT_ERROR", "result": "FAILURE", "conditionalResult": null, "visualTestResult": null, "startTime": "2024-05-29T07:29:47Z", "endTime": "2024-05-29T07:29:51Z", "duration": 3803, "visualEnabled": false }, { "id": "49b04ef4-40fa-476f-b2a7-17d7a6e68230", "testMachineResultId": 1434, "testCaseResultId": 3857, "testCaseId": 609, "stepId": 2851, "type": "NLP_TEXT", "action": "Enter 9876543212 in the Mobile Number Radio Button field", "message": "Major Test step failed.", "errorCode": null, "errorType": null, "result": "NOT_EXECUTED", "conditionalResult": null, "visualTestResult": null, "startTime": "2024-05-29T07:29:54Z", "endTime": "2024-05-29T07:29:54Z", "duration": 1, "visualEnabled": false }, { "id": "0a2c386f-5639-4276-b69e-f8715cd7a85c", "testMachineResultId": 1434, "testCaseResultId": 3857, "testCaseId": 609, "stepId": 2852, "type": "NLP_TEXT", "action": "Click on Continue Button", "message": "Major Test step failed.", "errorCode": null, "errorType": null, "result": "NOT_EXECUTED", "conditionalResult": null, "visualTestResult": null, "startTime": "2024-05-29T07:29:54Z", "endTime": null, "duration": 0, "visualEnabled": false } ], "totalElements": null, "totalPages": 1, "pageable": null, "last": false, "numberOfElements": 6, "first": true, "sort": null, "number": 0, "size": 100, "empty": false } |
In the response body above, we fetched the test step results of a test case with result ID 3857.