Ask a Question

Not able to add teststep

dsaju
Occasional Contributor

Not able to add teststep

Hi , 

 

I am not able to add multiple teststeps using the REST endpoint

/testresult

 
I am sending the below sample body but I only see the index 0 on the webpage 
 
[
    {
      "status""Pass",
      "testCaseKey""TTT-T84",
      "comment""The test has failed on some automation tool procedure.",
      "executionTime"180000,
      "executedBy""tomation01",
      "assignedTo""tomation01",
      "actualStartDate""2016-02-14T19:22:00-0300",
      "actualEndDate""2016-02-15T19:22:00-0300",
      "scriptResults": [
        {
          "index"0,
          "status""Pass",
          "comment""This step has pass."
        },
        {
          "index"1,
          "status""Pass",
          "comment""This step has failed."
        },
        {
          "index"2,
          "status""Pass",
          "comment""This step has failed."
        }
      ]
    }
]
 
11 REPLIES 11
dsaju
Occasional Contributor

Re: Not able to add teststep

Any update on my query would be much appreciated ? Is there any known limitation here ?

MisterB
Community Leader

Re: Not able to add teststep

Hi,

 

I've not used the API but I think the update you're making is to the execution of a Test Cycle (which is a Test Run in the API).  I think what you're trying to do is update test results for executed Test Cases and I think this is the API you need: 

 

/testrun/{testRunKey}/testcase/{testCaseKey}/testresult

 

"Creates a new Test Result on the specified Test Run, looking for an item that matches the testCaseKey..."

 

Good luck!

 

Andy

dsaju
Occasional Contributor

Re: Not able to add teststep

Thanks for the answer but my problem is that only index 0 is updated in the final results . index 1 is siliently ignored . I also tried the endpoint suggested by you . 

 

 

 

[
    {
      "status""Pass",
      "testCaseKey""TTT-T84",
      "comment""The test has failed on some automation tool procedure.",
      "executionTime"180000,
      "executedBy""tomation01",
      "assignedTo""tomation01",
      "actualStartDate""2016-02-14T19:22:00-0300",
      "actualEndDate""2016-02-15T19:22:00-0300",
      "scriptResults": [
        {
          "index"0,
          "status""Pass",
          "comment""This step has pass."
        },
        {
          "index"1,
          "status""Pass",
          "comment""This step has failed."
        },
        {
          "index"2,
          "status""Pass",
          "comment""This step has failed."
        }
      ]
    }
]
 
MisterB
Community Leader

Re: Not able to add teststep

Hi,

 

Looking at your original block of code, I'm wondering if you need to include some/all of the block of code I've highlighted red below for each index in your code.  My guess is that there are some mandatory fields that need to be included, like "testCaseKey".  If you've tried that already, there is the SmartBear support team - they'll come back to you with an answer I'm sure.

 
[
    {
      "status""Pass",
      "testCaseKey""TTT-T84",
      "comment""The test has failed on some automation tool procedure.",
      "executionTime"180000,
      "executedBy""tomation01",
      "assignedTo""tomation01",
      "actualStartDate""2016-02-14T19:22:00-0300",
      "actualEndDate""2016-02-15T19:22:00-0300",
      "scriptResults": [
        {
          "index"0,
          "status""Pass",
          "comment""This step has pass."
        },
        {
          "index"1,
          "status""Pass",
          "comment""This step has failed."
        },
        {
          "index"2,
          "status""Pass",
          "comment""This step has failed."
        }
      ]
    }
]
 
Best, Andy
ben2
New Contributor

Re: Not able to add teststep

Hi.

Please keep on update if you solve this problem, because I have similar issue and trying to find solution, will be thankful to you.

dsaju
Occasional Contributor

Re: Not able to add teststep

Hi Andy ,  of course I am adding the mandatory fields . I have updated my message to avoid any confusion there 

MisterB
Community Leader

Re: Not able to add teststep

Hi,,

 

Just checking if we're talking about the same thing because I can't see that your message has been updated.  I wondered if an approach like this would work, where you repeat the fields for each index.  If this doesn't work then I'm out of ideas and recommend you raise a request with the support team.  Good luck with your issue!

 

Andy 

 

[
    {
      "status": "Pass",
      "testCaseKey": "TTT-T84",
      "comment": "The test has failed on some automation tool procedure.",
      "executionTime": 180000,
      "executedBy": "tomation01",
      "assignedTo": "tomation01",
      "actualStartDate": "2016-02-14T19:22:00-0300",
      "actualEndDate": "2016-02-15T19:22:00-0300",
      "scriptResults": 
[
        {
           "index": 0,
          "status": "Pass",
          "comment": "This step has pass."
         }
],
      "status": "Pass",
      "testCaseKey": "TTT-T84",
      "comment": "The test has failed on some automation tool procedure.",
      "executionTime": 180000,
      "executedBy": "tomation01",
      "assignedTo": "tomation01",
      "actualStartDate": "2016-02-14T19:22:00-0300",
      "actualEndDate": "2016-02-15T19:22:00-0300",
      "scriptResults":
[
        {
          "index": 1,
          "status": "Pass",
          "comment": "This step has failed."
        }
],
etc.
]

 

 
dsaju
Occasional Contributor

Re: Not able to add teststep

I am afraid but this approach also does not help . Its ends up adding no steps in the final results and add 2 runs for the same testcase . 

 

So , to summarise I am using the endpoint /testrun/{testRunKey}/testresults and want to have each entry under the "scriptResults" section shown in final results but only index 0 is updated . This means that I can only upload result of one test step to the final status. The JSON body in the original query as per the API documentation (https://support.smartbear.com/zephyr-scale-server/api-docs/v1/)  .

 

This seems to be defect according to me as I am not able to upload the complete results to Zephyr unless I am doing something wrong here . 

 

MisterB
Community Leader

Re: Not able to add teststep

I am sorry to say that's me out of ideas.  I can't see anything wrong with what you're doing.  I've added a link below to the SmartBear support team who should be able to answer this for you.  If you find a solution maybe post it here too so we can share in your findings 🙂

 

Login - Jira Service Management (atlassian.net)

 

Good luck!

cancel
Showing results for 
Search instead for 
Did you mean: