Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Considering a scenario, When executing a Test Run manually, there is an option to pass/fail/block etc to each test case and test step. How can these test case/step results be updated using the Open API? Here's how you do it.

...

Example 

  1. Get testRunIssueId from test run.



  2. Execute the API mentioned above by specifying the value for testRunIssueId , refer an attachment below:
    Image Removed
    and use the following body parameters.


   Image Added

     Body:

     


Code Block
titleBody
{"projectId":"10001",
"offset":0,
"automationRun":true,
"whereClause":[],
"assignedToUsers":[],
"executionResult":[],
"testScenarioWithDefectRequired":false
}


See the output :

Image Modified

Steps for getting testResultId of test steps:

We can get the testResultId of the test steps, if you want to update the execution result of the test steps. We need to run below API.

Code Block
titlePOST Expand Test Step execution details
Post /testrun/testexecution/:testRunIssueId/:testResultId

Description

POST  Test Steps which are linked with Test Case.


Example 

  1. Need to specify testRunIssueIdtestCaseIssueId for making an API call. Refer an attachment.
    Image Removed
    Image Added

  2. See the output:

    Image Modified

Steps for updating execution result for test case & test steps:

Now we have testResultId for both test case and test steps, need to proceed with updating test case/ test steps execution result. As indicated in very first attachment - test case and all associated test steps are marked as

Status
colourBlue
titleNOT EXECUTED
 Let's update test case as
Status
colourGreen
titlePASS
 and associated test steps as
Status
titleBLOCKED
 &
Status
colourRed
titleFAIL
 using below API.


Code Block
titleUpdate comment, execution result or actual result
PUT /testrun/{testRunIssueId}/update

Description

You can update either comment, actual result, execution result or all of them together. Here you can directly pass test result id or multiple issue ids. Here is the help document for this API in detail.


Example

  1. Specify testRunIssueId in Parameters and JSON inside Body part. We need to add the "result" and "testResultId" attributes in the API in order to update the execution status of the test case & test steps. Refer to attachments.







  2. See the final Output with updated execution results.


Note: In order to automatically propagate Test Step execution result to Test Case, enable 'Automatically propagate Test Step execution result to Test Case' under Execution Preferences in QMetry Configuration.