Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

how to link/add testcases to test suites with rest api (xml template)

 <?xml version="1.0" encoding="UTF-8"?>

<ns2:testcase xmlns:ns2="http://jazz.net/xmlns/alm/qm/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?

0 votes


Accepted answer

Permanent link

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

durga sankar selected this answer as the correct answer

0 votes

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 

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937
× 1,700
× 218
× 113
× 85

Question asked: Apr 19 '21, 11:49 a.m.

Question was seen: 1,611 times

Last updated: May 20 '21, 4:12 a.m.

Confirmation Cancel Confirm