It's all about the answers!

Ask a question

RQM 6.0: how to get List of linked Test Case execution records in test case using OSLC/REST


Naveen Tyagi (19769152) | asked May 05 '16, 2:29 a.m.
edited May 05 '16, 2:30 a.m.
I want to  get the list of TCER in test case using OSLC/REST. I have looked into the Test case RDF but didn't find URL for TCER. Thanks in advance.

4 answers



permanent link
Paul Slauenwhite (8.4k12) | answered May 05 '16, 7:45 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hi Naveen,

The TCER (com.ibm.rqm.execution.TestcaseExecutionRecord) references a test case (com.ibm.rqm.planning.VersionedTestCase) - see http://open-services.net/bin/view/Main/QmSpecificationV2#Resource_TestExecutionRecord.

Have you considered using the RQM Reportable REST API?

Comments
Naveen Tyagi commented May 05 '16, 10:12 a.m.

Thanks Paul for response.
In my case scenario is just opposite. I am able to get the test case through Test case Id using OSLC query but want to get the TCER(s) to that test case. I have looked into the Test case API and RDF response but didn't find anything related to linked TCER. am i missing something ?


Paul Slauenwhite commented May 05 '16, 1:14 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Naveen, we do not model the TCER reference in the test case.  Instead, the test case reference is modeled in the TCER.


Naveen Tyagi commented May 05 '16, 11:41 p.m.

I have been trying hard to get this from Test case but as you said it is not there.
Is there any OSLC query or something i can get the TCER(s) linked to Testcase id xxx.? Thanks in advance.


Paul Slauenwhite commented May 06 '16, 6:54 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Yes:

GET https://<host>:<port>/<context root>/oslc_qm/contexts/<project area UUID>/resources/com.ibm.rqm.execution.TestcaseExecutionRecord?oslc.where=oslc_qm:runsTestCase=< https://<host>:<port>/<context root>/oslc_qm/contexts/<project area UUID>/resources/com.ibm.rqm.planning.VersionedTestCase/<resource item ID>>

Make sure you URL encode the oslc.where parameter value.


Naveen Tyagi commented May 09 '16, 1:32 a.m. | edited May 09 '16, 1:36 a.m.

Hi paul,
I have changes the project Id and context URL but it is showing nothing.
Error 501: SRVE0295E: Error reported: 501

https://Myserver/qm/oslc_qm/contexts/_x3K0ug6TReSTjIlhlyRM-Q/resources/com.ibm.rqm.execution.TestcaseExecutionRecord?oslc.where=oslc_qm:runsTestCase=< https://Myserver/qm/oslc_qm/contexts/_x3K0ug6TReSTjIlhlyRM-Q/resources/com.ibm.rqm.planning.VersionedTestCase/809


Paul Slauenwhite commented May 09 '16, 7:41 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Two things:

-Change 809 for the UUID of the test case.
-Add the > character to the end of the oslc.where value.

You can check the RQM logs for warnings/errors when you don't see the results you would expect when using the RQM OSLC API.

showing 5 of 6 show 1 more comments

permanent link
Anurag Patel (21363) | answered Feb 16 '18, 1:42 a.m.
edited Feb 16 '18, 4:47 a.m.

Comments
Paul Slauenwhite commented Feb 16 '18, 7:00 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

https://d-9376:9443/qm/oslc_qm/contexts/_pbsSEP9wEee-4tAhUSdolw1>/resources/com.ibm.rqm.planning.VersionedTestCase/1 is not a proper URL for a OSLC test case.  The last segment of the URL should be an UUID.


Anurag Patel commented Feb 20 '18, 2:40 a.m.

 Thanks @Paul Slauenwhite for your valuable help. My problem is I want to get TCER associate with test case, but as per RQM specification Test case associate with TCER. I am trying to get TCER from test case using your query but getting 401 error. Can you please correct


Paul Slauenwhite commented Feb 20 '18, 7:40 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Anurag, your request query is correct except for the URL of the test case.  The format should be:

https://<host>:<port>/<context root>/oslc_qm/contexts/<project area UUID>/resources/<resource type>/<resource item ID>

That is:

https://d-9376:9443/qm/oslc_qm/contexts/_pbsSEP9wEee-4tAhUSdolw1>/resources/com.ibm.rqm.planning.VersionedTestCase/<resource item ID>


permanent link
Anurag Patel (21363) | answered Feb 20 '18, 8:16 a.m.

 Hi @Paul Slauenwhite thanks for quick reply, I updated my test case url as below:


But my requirement is I want to fetch tcer of test case using query. Can you please help me to build that query, which fetch tcer associate with test case. Here I pasted my url, please guide me to resolve query:


Comments
Paul Slauenwhite commented Feb 20 '18, 8:22 a.m. | edited Feb 20 '18, 8:34 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

The test case URL is still wrong.

Try querying for all the test cases to see the format of OSLC URLs:

GET https://d-9376:9443/qm/oslc_qm/contexts/_pbsSEP9wEee-4tAhUSdolw1/resources/com.ibm.rqm.planning.VersionedTestCase


Anurag Patel commented Feb 20 '18, 8:28 a.m.

 Hi @Paul Slauenwhite , sorry for mistakes I am new to Jazz environment. My requirement is I want fetch TCER associated with test case. Can you please provide information or query for same.  I tried your query which was previously provided by you, but it gives 401 error. My TCER id is 1 and test case id is also 1. Can you please correct my url/query. 


1
Paul Slauenwhite commented Feb 20 '18, 8:37 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Anurag, your query request URL is correct except:

-The project area UUID contains an invalid > character (_pbsSEP9wEee-4tAhUSdolw1>).

-The test case URL is incorrect since the last segment of the URL should be an UUID.  1 is not an UUID.  


Anurag Patel commented Feb 20 '18, 8:56 a.m.

 Hi @Paul Slauenwhite, I corrected my URL please check,it also gives me 400 error: 



Paul Slauenwhite commented Feb 20 '18, 11:49 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Surround the test case URL in < and >.  You need to read/understand http://open-services.net/bin/view/Main/OSLCCoreSpecQuery.


Anurag Patel commented Feb 21 '18, 1:24 a.m.

 @Paul Slaunwhite, Thanks , but I am not getting my question's answer. Can we get/fetch TCER which is associated with Test Case by using test case id or URL?


Anurag Patel commented Feb 21 '18, 7:08 a.m.

 @Paul Slaunwhite Could you please help me to tell How to get UUID of test case?


Paul Slauenwhite commented Feb 21 '18, 7:48 a.m. | edited Feb 21 '18, 7:49 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Anurag, yes, you can read the TCERs associated with a specific test case (URL) using your query:

Request:
GET https://d-9376:9443/qm/oslc_qm/contexts/_pbsSEP9wEee-4tAhUSdolw/resources/com.ibm.rqm.execution.TestcaseExecutionRecord?oslc.where=oslc_qm%3ArunsTestCase%3D%3Chttps%3A%2F%2Fd-9376%3A9443%2Fqm%2Foslc_qm%2Fcontexts%2F_pbsSEP9wEee-4tAhUSdolw%2Fresources%2Fcom.ibm.rqm.planning.VersionedTestCase%2F_BKcLQfXtEeevMKrERW9Sqg%3E

Headers:
OSLC-Core-Version = 2.0
Accept = application/xml

Assumptions:
RQM public root = https://d-9376:9443/qm
Project area UUID = _pbsSEP9wEee-4tAhUSdolw
Test case UUID = _BKcLQfXtEeevMKrERW9Sqg
Request parameter (oslc.where) value is URL-encoded.
Project area is not Configuration Management-enabled (see https://jazz.net/wiki/bin/view/Main/RqmOslcQmV2Api#oslc_config_context).

To verify the test case URL, read (GET) the test case.

I would still recommend reading/understanding http://open-services.net/bin/view/Main/OSLCCoreSpecQuery and RQM OSLC QM API.


showing 5 of 8 show 3 more comments

permanent link
Anurag Patel (21363) | answered Feb 20 '18, 10:34 a.m.

@Paul Slauenwhite Can you please help me to correct my URL in previous comment. I provided UUID of test case as mentioned by you for getting TCER which is associate with test case. But still I am not getting 400 resource not found error


Comments
Paul Slauenwhite commented Feb 22 '18, 6:43 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Anurag, did you verify the test case URL by reading (GET) the test case?

Request:
GET https://d-9376:9443/qm/oslc_qm/contexts/_pbsSEP9wEee-4tAhUSdolw/resources/com.ibm.rqm.planning.VersionedTestCase/_BKcLQfXtEeevMKrERW9Sqg

Headers:
OSLC-Core-Version = 2.0
Accept = application/xml

Your answer


Register or 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.