Overview of the problem

I am trying to update test execution statuses of tests that are not automated (i.e. test scripts that cover multiple manual test cases), but I am having problems doing this via the ALM API.

Basically, I am trying to do the following:

automation_test_set_for_release => test_script => test_case_1 (Passed!  Mark the status in manual_test_set_for_release\test_case_1)
                                                  test_case_2 (Passed!  Mark the status in manual_test_set_for_release\test_case_2)
                                                  test_case_3 (Failed!  Mark the status in manual_test_set_for_release\test_case_3)
manual_test_set_for_release => test_case_1 (Passed, because test_script marked this case as passed)
                               test_case_2 (Passed, because test_script marked this case as passed)
                               test_case_3 (Failed, because test_script marked this case as failed)

The reason we want to do this is because we have a large number of test cases covered by a smaller number of test scripts, so the count of coverage seems artificially low versus actual coverage and the team would like to break out individual test case statuses if at all possible.

Where I'm stuck

I can drill down into a specific test set's test instance by using the following query:

GET http://host:port/qcbin/rest/domains/domain/projects/project/test-instances?query={cycle-id[55080];test-id[27322]}

This will give me the details of the test (all of the fields related to that test set's test instance. If I use the same URL to attempt to PUT new data, such as:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Entity Type="test-instance"><Fields><Field Name="status"><Value>Failed</Value></Field></Fields></Entity>

I am returned a failure with a stack trace, such as:

<StackTrace>java.lang.IllegalArgumentException: java.lang.ClassCastException@381ee243
at sun.reflect.GeneratedMethodAccessor395.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)

I have a feeling that the ?query= portion of my URL is causing the issue, but I do not know of another way to update a specific test set's test instance execution status.

Is there a better way to do this?


I figured it out

I had to pull the "id" value from the GET query and use that on the following PUT call:

PUT http://[host]:[port]/qcbin/rest/domains/[mydomain]/projects/[myproject]/test-instances/[id_from_GET_call]

Only then could I set the value of "status" successfully. I think the problem was you have to have one point of reference on a PUT call, whereas the ?query= call was taking ALL test-instances and filtering on a specific one. This was now how to do it, so I'm glad I figured it out :) Hope this helps others.

protected by Niels van Reijmersdal Sep 23 '16 at 11:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.