how to link/add testcases to test suites with rest api (xml template)
<?xml version="1.0" encoding="UTF-8"?>
xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1"
xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ns4="http://purl.org/dc/elements/1.1/"
xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/"
xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/"
<ns4:title>TestCase</ns4:title>
<ns4:description>Test Case Creation through Rest API </ns4:description>
<ns5:state>com.ibm.rqm.planning.common.new</ns5:state>
<ns2:variables/>
<ns2:scriptStepCount>1</ns2:scriptStepCount>
<ns2:remotescript href="https://<localhost>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_joJ8cP-MEeeJ27a7PHh-Ow/remotescript/urn:com.ibm.rqm:remotescript:20194" />
<ns2:template href="https://<localhost>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_M_xHQMoFEeqQKPfhtQ8FFw/template/testcase/com.ibm.rqm.planning.templates.testcase.default"/>
</ns2:testcase>
what attribute should i need to add or what i need to do to link testsuite and test script?
Accepted answer
Hi Durga,
To link test script to test suite, you need to enable a property.
Go to Administration -> Manage Project Properties -> Test Case/Suite Preferences -> Use test scripts in test suites
Enable the property Use test scripts in test suites by clicking on the checkbox. Once saved, refresh the page.
Now you can add test script to test suite using web UI or REST API too.
You can also set <ns2:scriptExecution>true</ns2:scriptExecution> in REST PUT Body to mark the suite for script execution.
Thanks,
Monika Rajput
Comments
hello Monika,
Actually i am using python for automate the process of TC,TestScript and suite creation and update. with "<ns2:remotescript href="<link>" />" i am able to link TC with testscript. But i need to add multiple testcases to testsuite. so how can i pass test suite (already created) link to test case xml template. with which tag ? i tried "<ns2:testsuite " and few others from jazz site. but not got any result. or else how can i link testcase(already created) to test suite with which tag and namespace?
Hi,
To add test cases to test suite, you can use the following syntax in the Test Suite PUT XML body :
<ns2:suiteelements>
<ns2:suiteelement elementindex="0">
<ns2:testcase href="https://<host>:<port>/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project_area_alias>/testcase/urn:com.ibm.rqm:testcase:<testcase_web_id>"/>
</ns2:suiteelement>
</ns2:suiteelements>
thank you... for the help monika