Support

Expand all | Collapse all

Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error

Jump to Best Answer
  • 1.  Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error

    Posted 05-02-2017 09:33
    When I attempt to update a test run via the REST API I get

    "Mismatch in number of steps. Cannot execute Test Run."

    I have removed the test steps via the UI and I still get this error.  When we imported the test cases from another program we had a single step in the test case that is not needed.  I would have thought that removing the step would have resolved the error.  Any idea why it wouldn't.  Also it would be nice to be able to ignore step results via the REST API.


    ------------------------------
    Matt Kaiser
    OSI
    ------------------------------


  • 2.  RE: Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error

    Posted 05-02-2017 09:37

    This might be because the test result was already created? When the testcase did have steps?

     

    I also found having to supply step results not intuitive for automated processes.

     

    Sam

     






  • 3.  RE: Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error

    Posted 05-02-2017 09:47
    Sam,
    Thanks for the help.  I had to delete the existing test runs.

    Jama Developers,
    It would be very helpful to have an option to force all test steps to passed if the test run is marked as pass or a similar behavior for failures.

    ------------------------------
    Matt Kaiser
    OSI
    ------------------------------



  • 4.  RE: Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error

    Posted 05-02-2017 10:46

    In my code I got the count of test steps and added that result info when updating the test run.

     

    Sam

     






  • 5.  RE: Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error

    Posted 05-02-2017 11:01

    in the testrun data/fields is the array testRunSteps.. get the size of the array.

     

    Then reset the array of structures  with "testRunSteps": [ {"status": "FAILED" or "PASSED"}, (repeat for each step) ]

     






  • 6.  RE: Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error

    Posted 05-30-2017 10:00
    Is it possible to update a single test case step? I'm using the test_trigger.py file i found on git to run the test case steps. I can run each step individually but upon making the patch request, i also get the Mismatch error...

    Example of the params I'm sending along:

    paramsTest = [{"op": "replace", "path": "/fields/testRunSteps", "value": [{ "status": "PASSED"}]}]

                        r = requests.patch("https://mysite.jamacloud.com/rest/latest/testruns/" + str(test_run_id), json = paramsTest, auth=auth)

                        print(r.text)

    I've tried a few ways to access the correct testCaseSteps dict that i need to update the status for, but none have worked so far.

    ------------------------------
    afranklin
    ------------------------------



  • 7.  RE: Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error
    Best Answer

    Posted 05-30-2017 10:47
    from my testing, you MUST update all the step steps at once. even if only changing 1.

    ------------------------------
    Sam
    ------------------------------



  • 8.  RE: Posting test results via REST returns a "Mismatch in number of steps. Cannot execute Test Run." error

    Posted 08-10-2018 02:26
    Hello,

    Is there any solution to this issue?


    I want to execute TestRun and ignoring the TestSteps.

    Or, is there any RestAPI to execute the testSteps or to change their status for the current TestRun?


    Best Regards,
    Ibrahim

    ------------------------------
    Ibrahim Farhan
    PANAPIDEU
    ------------------------------