How to create Test Case Execution Records and Test Case Execution Workitems via REST API?
![]()
Hi,
I am trying to create Test Case Execution Records and Test Case Execution Workitems via REST API. I can already download testplans, testcases, testscripts, executionrecords and executionworkitems, and I can upload the XML files, that I downloaded. But I am unable to create new TCER from scratch with a generated ID. https://jazz.net/wiki/bin/view/Main/RqmApi#Create does not help. It gives no indication what exactly to send. The tip from https://sleroyblog.wordpress.com/2013/04/09/querying-rqm-40-through-oslc-and-rest-api/ Create a Test Case Execution Results (ext ID “myChosenID”) Other things to keep in mind: If providing an external ID, you should make sure your PUT does NOT contain any /urn:com.ibm.rqm:xxxxxx content (this is reserved for GUI created test artifacts). does not work. The server responds with "The uploaded file is not properly formatted XML", although there is no file to be uploaded in the first place, I am trying to generate one from scratch. On the web-interface I can create Executionresults and TCER, but the two documents reference each other (via href). How would I patch existing XML files with yet to be created WebId's for upload? How do I create a blank TCER and/or execution workitem, that I then can download and fill in? Can somebody please provide an example HTTP-request for either (a) creating an empty executionresult and executionworkitem. or (b) a minimal dummy executionresult-XML and executionworkitem-XML to upload it to create a new executionresult and executionworkitem. I feel that once there is one in the system with a proper ID, I can update it by downloading it and re-uploading it. An example with "poster" would also be fine; but Excel/Word are not ok (we're not on Windows) Kind regards Stefan Schröder - Germany RQM Application 5.0.2 Rational Jazz Team Server Version: 5.0.2 |
3 answers
![]()
Hi Stefan,
A test case execution result requires a test case execution record. However, you can create a test case execution record from the RQM UI without a test case execution result. When learning how to create new test resources using the RQM Reportable REST API , follow https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip. Note, use the RQM XML schema documentation (https://jazz.net/wiki/bin/view/Main/RqmApi#Detailed_Schema_Documentation) to determine the required/optional/read-only properties of the test resources. Comments Ok, thank you. Paul, for the quick response. I will investigate the resources that you mentioned. Am I reading your response correctly, that it is always required to upload a fully compliant (according to the xsd) item, even when creating one from scratch?
Yes. To be compliant, all required (writable) properties must be set.
Hi Paul,
PUT requests require an ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#PUT_requests). It's not the webId property of the resource, but the ID segment of the request URL.
Hi Paul,
|
![]() Hello Stefan ,
|
![]() What have you done/tried already?
I use curl for the http-interaction with the RQM-server. I use bash shell scripts as glue-code. I use XML templates for providing the results and I use Perl scripts to fill in the desired values in my XML templates.
It all works now, but it's not trivial. It all starts with a plan. I download the plan in XML: I extract the test-script IDs from the plan. I download the test-scripts, etc. and on it goes. If you ask a more specific question, I can help you more efficiently.
Environment is cygwin in Windows, but should also work for Linux.
|