Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,182
Community Members
 
Community Events
165
Community Groups

How to update the Test Execution result of a particular Test Step within it using REST api?

Edited

Hi,

I'm trying to update the Test Execution result of a particular Test Step within it using REST api. I referred the Test Step Results - REST documentation, however, the solution doesn't produce the output that I expect. Here are the detailed steps that I followed:

  1. Created a Test Execution using REST.
    Request: curl -H "Content-Type: application/json" -X POST -u admin:admin --data @test-execution.json http://{XRAY-Server}/rest/raven/1.0/import/execution
    Response: {"testExecIssue":{"id":"48033","key":"XRAYT-362","self":"http://{XRAY-Server}/rest/api/2/issue/48033"}}
  2. Update the same Test Execution for a particular Test Step
    JSON: test-execution-update.json
    {
       "id":"48033",
       "status":"FAIL",
       "comment":"Expected '5' to equal '10'.",
       "evidences":[
          {
             "data":"iVBORw0KGgoAAAANSUhEUgAA..[base64-image]",
             "filename":"screenshot.png",
             "contentType":"image/png"
          }
       ],
       "actualResult":"The actual result for 1177"
    }

    Request: curl -H "Content-Type: application/json" -X PUT -u admin:admin --data @test-execution-update.json http://{XRAY-Server}/rest/raven/1.0/api/testrun/48033/step/1176/
    Response: Test Run with Id 48,033 was not found in the server

As you can see the Test Run id is used later is same as was generated by the earlier response. So it's weird to get such response.

Has anyone faced such issue? Any help would be much appreciated.
Thanks in advance :)

 

Regards,
Siddhesh Malpani

 

1 answer

Hi @Sid , 

The ID that you're using is the Issue Id of the Test Execution, not the Test Run ID.
To fetch the Test Run ID, please follow the guide of our support documentation: https://confluence.xpand-it.com/display/public/XRAY/Test+Runs+-+REST

If you have any questions, please contact our support service desk.

Best Regards,

Team Xray

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you