Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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.

0 votes



4 answers

Permanent link
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?

0 votes

Comments

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 ?

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

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.

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.

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

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

 Hi @Paul Slauenwhite your answer is very helpful, I tried following url but it gives 401 resource not found error. Could you please help me to correct my URL


0 votes

Comments

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.

 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

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

 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:

0 votes

Comments

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

 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. 

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.  

1 vote

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


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

 @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?

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

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

@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

0 votes

Comments

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,950

Question asked: May 05 '16, 2:29 a.m.

Question was seen: 4,334 times

Last updated: Feb 22 '18, 6:43 a.m.

Confirmation Cancel Confirm