Lakshmi Vignesh
Lakshmi Vignesh

Reputation: 31

how to append more test cases to a test set using rally rest api and java

how to append more test cases to a test set using rally rest api and java.

I want to add more testcases to that testset. As of now , I can add only collection of testcases to a testset.

What if I have to add few more testcase to a testset?

Upvotes: 2

Views: 557

Answers (1)

Michael B
Michael B

Reputation: 341

If you add the Test Cases you would like to appended to the Test Set to an Array, you can then update the Test Set using the CollectionUpdateRequest and updateCollection method.

JsonArray testCaseRefs = new JsonArray();
JsonObject testCaseRef = new JsonObject();
testCaseRef.addProperty("_ref", "/testcase/12345");
testCaseRefs.add(testCaseRef);

CollectionUpdateRequest testsetTestCasesCollectionAddRequest = new CollectionUpdateRequest("/testset/23456/testcases", testCaseRefs, true);
CollectionUpdateResponse testsetTestCasesCollectionAddResponse = restApi.updateCollection(testsetTestCasesCollectionAddRequest);

More information is available at, https://github.com/RallyTools/RallyRestToolkitForJava/wiki/User-Guide#update-collection

Upvotes: 2

Related Questions