how to create a testcase?
![](http://jazz.net/_images/myphoto/455a0644415bb664b7c0e9cc44aef77c.jpg)
I am still stuck at how to create a new testcase using C# in IBM CLM Quality Manager.
I read documentation that i can use :Rational Quality Manager Reportable REST API using a POST:
https://jazz.net/wiki/bin/view/Main/RqmApi#Create
HttpWebRequest documentGet = (HttpWebRequest)WebRequest.Create(url);//<singleprojectFeedUrl> ?
documentGet.Method = "POST";
documentGet.ContentType = "application/xml ";//
documentGet.Referer = "https://timo-pcvirtual:9433/qm";
documentGet.Headers.Set("OSLC-Core-Version", "2.0");//do i need this ?
documentGet.Timeout = 300000;
I guess after i send this i need to get from response "Content-Location" header?
Its not clear also how to create an xml with the testcase info i want to send. I searched the net i found a schema of the document i need to send ... (ps i am an embedded sw developer so these things are pretty new for me -_-)
https://jazz.net/products/rational-quality-manager/api-doc-4.0.6/
Thank you very much for your help...I appreciate your time spent to help me with this :(
I read documentation that i can use :Rational Quality Manager Reportable REST API using a POST:
https://jazz.net/wiki/bin/view/Main/RqmApi#Create
-
HTTP Request:
POST
- URL: <singleProjectFeedUrl>
-
HTTP Request Headers:
Content-Type
,Referer
- Content to Send: <XML representation of the resource>
-
HTTP Response Code:
201
-
HTTP Response Header:
Content-Location
HttpWebRequest documentGet = (HttpWebRequest)WebRequest.Create(url);//<singleprojectFeedUrl> ?
documentGet.Method = "POST";
documentGet.ContentType = "application/xml ";//
documentGet.Referer = "https://timo-pcvirtual:9433/qm";
documentGet.Headers.Set("OSLC-Core-Version", "2.0");//do i need this ?
documentGet.Timeout = 300000;
I guess after i send this i need to get from response "Content-Location" header?
Its not clear also how to create an xml with the testcase info i want to send. I searched the net i found a schema of the document i need to send ... (ps i am an embedded sw developer so these things are pretty new for me -_-)
https://jazz.net/products/rational-quality-manager/api-doc-4.0.6/
Thank you very much for your help...I appreciate your time spent to help me with this :(
One answer
![](http://jazz.net/_images/myphoto/455a0644415bb664b7c0e9cc44aef77c.jpg)
Hi George,
We have a opensource Java based API utility which you refer. You can have a look at the source code . Link for it is https://jazz.net/wiki/bin/view/Main/RqmApi#RQM_API_Utility
The syntax for a sample testcase xml is as below
<?xml version="1.0" encoding="UTF-8"?>
<ns2:testcase xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns1="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://purl.org/dc/elements/1.1/" xmlns:ns4="http://jazz.net/xmlns/prod/jazz/process/0.6/" xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://purl.org/dc/terms/" xmlns:ns7="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns13="http://open-services.net/ns/core#" xmlns:ns14="http://open-services.net/ns/qm#" xmlns:ns15="http://jazz.net/xmlns/prod/jazz/rqm/process/1.0/" xmlns:ns16="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns17="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns19="http://jazz.net/xmlns/alm/qm/styleinfo/v0.1/" xmlns:ns20="http://www.w3.org/1999/XSL/Transform">
<ns3:title>Organizations can Apply</ns3:title>
<ns3:description/>
<ns2:category value="Developer Test" term="Test Phase"/>
<ns2:variables/>
<ns2:testscript href="https://localhost:9444/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/JKE+Banking+%28Quality+Management%29/testscript/urn:com.ibm.rqm:testscript:17"/>
</ns2:testcase>
You can even create a testcase in RQM UI. Then do a GET of that testcase and get the syntax for testcase xml
Thanks
We have a opensource Java based API utility which you refer. You can have a look at the source code . Link for it is https://jazz.net/wiki/bin/view/Main/RqmApi#RQM_API_Utility
The syntax for a sample testcase xml is as below
<?xml version="1.0" encoding="UTF-8"?>
<ns2:testcase xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns1="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://purl.org/dc/elements/1.1/" xmlns:ns4="http://jazz.net/xmlns/prod/jazz/process/0.6/" xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://purl.org/dc/terms/" xmlns:ns7="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns13="http://open-services.net/ns/core#" xmlns:ns14="http://open-services.net/ns/qm#" xmlns:ns15="http://jazz.net/xmlns/prod/jazz/rqm/process/1.0/" xmlns:ns16="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns17="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns19="http://jazz.net/xmlns/alm/qm/styleinfo/v0.1/" xmlns:ns20="http://www.w3.org/1999/XSL/Transform">
<ns3:title>Organizations can Apply</ns3:title>
<ns3:description/>
<ns2:category value="Developer Test" term="Test Phase"/>
<ns2:variables/>
<ns2:testscript href="https://localhost:9444/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/JKE+Banking+%28Quality+Management%29/testscript/urn:com.ibm.rqm:testscript:17"/>
</ns2:testcase>
You can even create a testcase in RQM UI. Then do a GET of that testcase and get the syntax for testcase xml
Thanks