It's all about the answers!

Ask a question

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

durga sankar (133) | asked Apr 19 '21, 11:49 a.m.

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

<ns2:testcase xmlns:ns2=""
<ns4:description>Test Case Creation through Rest API </ns4:description>
<ns2:remotescript href="https://<localhost>/qm/service/" />
<ns2:template href="https://<localhost>/qm/service/"/>

what attribute should i need to add or what i need to do to link testsuite and test script?

Accepted answer

permanent link
Monika Rajput (2412) | answered Apr 23 '21, 10:05 a.m.

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.

Monika Rajput

durga sankar selected this answer as the correct answer

durga sankar commented Apr 26 '21, 12:24 a.m.

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?

Monika Rajput commented Apr 27 '21, 2:12 a.m.


To add test cases to test suite, you can use the following syntax in the Test Suite PUT XML body :
        <ns2:suiteelement elementindex="0">
            <ns2:testcase href="https://<host>:<port>/qm/service/<project_area_alias>/testcase/<testcase_web_id>"/>

durga sankar commented May 20 '21, 4:12 a.m.

thank you... for the help monika 

Your answer

Register or to post your answer.