Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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:

<QCRestException>
<Id>qccore.general-error</Id>
<Title>java.lang.ClassCastException@381ee243</Title>
<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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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/domain/projects/project/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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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