Forum Discussion

dsaju's avatar
dsaju
Occasional Contributor
4 years ago

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."
        }
      ]
    }
]
 
  • dsaju's avatar
    dsaju
    Occasional Contributor

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

    • MisterB's avatar
      MisterB
      Champion Level 3

      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's avatar
        dsaju
        Occasional Contributor

        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."
                }
              ]
            }
        ]
         
  • ben2's avatar
    ben2
    New Contributor

    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.