Update Test Case results using API


In Testsigma, you can update the Test Case Results using API. This article discusses how to update Test Case results as Passed, Failed, and Not Executed using REST API.

This endpoint allows users to update the Test Case result using REST API.

Request Type PUT
Endpoint https://app.testsigma.com/api/v1/execution_results/<run_id>/override
The <run_id> can be obtained from the Run Results.
Authorization Bearer <API_Token>
Same as the Testsigma API key mentioned above.
Request Body Type (JSON) Raw
Request Body [
{
"testCaseResultId": 3646,
"comment": "Modifying the results 1",
"result": "SUCCESS"
}
]
Response Body(JSON) {
"errors": [],
"message": "Overridden the results successfully"
}

Request fields

testCaseResultId: ID of Test Case result.
comment: Comment you want to add to change the result.
result: The result you want to override the current result.

Response fields

errors: Errors in request fields if there are any.
message: Message of overridden results.

NOTE:
  1. In case of an invalid request, you will get the response body below and return the status code as 400.

    {
    "timeStamp": null,
    "error": "Failed to override the result,
    cause :Given test case result id 2288 is not related to execution run 239
    Given test case result id 2286 is not related to execution run 239
    Given test case result id 2287 is not related to execution run 239",
    "code": null,
    "fieldErrors": null,
    "objectErrors": null
    }
  2. In case of multiple requests which have both valid and invalid queries, you will get the response body as below as return status as 200.

    {
    "errors": [
    "Given test case result id 2286 is not related to execution run 239",
    "Given test case result id 2287 is not related to execution run 239"
    ],
    "message": "Overridden the result partially"
    }