How to post Test cases / Test suites from QM Rest Api
Good morning,
I am trying to import some test suites with an xml file to QM. For the moment I am just able to import single test cases manually.
Is it possible to import Test suites (Multiple test cases at once)?
How should I structure the Rest api call to do the import via Rest Api?
|
One answer
David Honey (1.8k●1●7)
| answered Nov 14 '22, 10:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Have you reviewed the information on https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding, especially the links to ETM REST APIs?
You might also want to look at the OSLC Primer.
Comments
Pablo Garijo
commented Nov 15 '22, 7:24 a.m.
I am currently trying this curl command to upload a test case via rest api
curl -X POST -k -H "Authorization: Basic cGFibG8uZ2FyaWpvOlBhbGFmb3g5" -H "oslc-core-version: 2.0" -H "Accept: application/rdf+xml" -H "Accept: application/xml" -i "https://doorsng.grupoantolin.com:9443/qm" -H "configuration-context: https://doorsng.grupoantolin.com:9443/qm/cm/stream/_UTSfAAdOEe2HeIm2C2mPgQ" -F "file=FILE.xml" --cookie "cookie.txt"
But I am getting error HTTP/1.1 302 Found
Your POST request is to "https://doorsng.grupoantolin.com:9443/qm". That looks like the context root of an ETM instance, and not the URI of a public REST service in ETM.
This means that you are redirected to a form based authentication. See https://rsjazz.wordpress.com/2021/10/15/elm-authentication/
Authentication can be a challenge. If you can use RESTClient in Firefox. That allows to access the web page, authenticate and then use RESTClient to GET/PUT/POST and the authentication is already done. It is also possible to use POSTMAN, but then you need an additional call for the Form based auth.
What is supported depends on the server setup. Basic Auth us only fallback for JAS. https://jazz.net/wiki/bin/view/Deployment/CreateCustomScenarios#Using_Curl_Script shows how to use cURL and Form Based Auth. |
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.