Forum Discussion

Demolag's avatar
Demolag
New Contributor
3 months ago

REST API - Update Test Step Execution Status with DataTable rows

Hi,

I've been trying to figure out how to update the execution status for test cases with datatable rows.

The example from the REST API page for Zephyr Server for PUT method on /testrun/{testRunKey}/testcase/{testCaseKey}/testresult shows how to update for specific test steps:

{
    "scriptResults": [
    {
      "index": 0,
      "status": "Fail",
      "comment": "This step has failed."
    }
    ]
}

But when I try to add the parameterSetId field, I get the error Unrecognized field "parameterSetId".

Is there another field or another REST API method I should use?

2 Replies

  • grarun11's avatar
    grarun11
    Occasional Contributor

    Demolag​ 

    How are you generating the test result? I am using Zephyr scale data center.

    When I try to upload result file in zip file format. I am getting format not valid.

    • Demolag's avatar
      Demolag
      New Contributor

      Hi grarun11​,

      Currently I'm not trying to upload any result file - I am just attempting to update the test run's status.
      Updating the status for the whole test-run works fine, also for updating the status for a specific step on tests without data-table.

      But when I want to update the step's status for a specific step on a specific datatable row, there is no specified way to tell the REST API which datatable row I am trying to update.

      For example:
      project: TEST
      testcases:
         TEST_T1:
             data table parameters: {"iteration": "iter1"}, {"iteration": "iter2"}
             steps: {"index":0, "description": "run {iteration}"}, {index:1, "analyze {iteration} results"}
      cycles:
         TEST_C1:
            testcases: TEST_T1

      Using /testrun/TEST_C1/testcase/TEST_T1/testresult with the following body:

      {
        "status": "Fail",
        "scriptResults": [
          {
            "index": 0,
            "status": "Fail",
          }
        ]
      }

      I can update both the test run's status as Fail and Step1 for the first datatable parameter iter1 as Fail, and by changing/adding more script results, I can use the index parameter to choose the test step, but there is no way to update any other datatable parameters. like if I want to set iter2-Step1 as Fail I have no way of specifying it to the REST API.