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

Execution Result of a Test Case

 Hello everyone.  I am trying to pull the execution result of a test case and seem to be running into a problem.

I am using a test case QM to pull info on the test case.  I use a data source configuration on a feed schema to pull execution result data, but it doesn't seem to be pulling the info.

Are there any templates that achieve this goal?

Thank you,
Dylan Mansour

0 votes


Accepted answer

Permanent link
Once you get the testcase URL, you can get executionworkitems filtered by testcase/@href. You may use the following Script Expression to configure new data source (_Execution Work Item Feed) :
var pos=identifier.indexOf(/testcase/); //Using testcase/identifier
var configURI=identifier.substring(0,pos);
configURI=configURI + "/executionworkitem?fields=feed/entry/content/executionworkitem[testcase/@href='" + identifier + "']/*"
configURI

You can then dynamically set feed/entry/content/executionworkitem/executionresult/href as the URI for another datasource (_Execution Result Details). executionresult/state/_value will give the execution results.

Note that, there can be multiple execution results. You can either print all or print the latest. If no execuition results found, you can print the state as "Not Executed".
ScreenSht - TemplateSample (Incomplete)
Dylan Mansour selected this answer as the correct answer

1 vote

Comments

 This is very helpful, thank you.  What is the query you use to configure your first data source?

Since you already have testase details, you can derive the url (using Data Source Configuration element) for _Execution Work Item Feed using following Script Expression:
//identifier = testcase/identifier attribute from _testcaseDetails datasource
var pos=identifier.indexOf(/testcase/);
var configURI=identifier.substring(0,pos);
configURI=configURI + "/executionworkitem?fields=feed/entry/content/executionworkitem[testcase/@href='" + identifier + "']/*"
configURI

So all in all 4 data sources - start with a RQM feed url, get _testcaseDetails, then _Execution Work Item Feed and finally _Execution Result Details.

 I finally have it pulling the url for each and every execution result; my javascript didn't parse it correctly so now I am working on that.  Thanks for the help!

What JS would you use to parse this:

com.ibm.rq
m.execution
.common.st
ate.failed
com.ibm.rq
m.execution
.common.st
ate.passed

You can use any script expression. for example

var mystate = _value;
mystate = mystate.replace("com.ibm.rqm.execution.common.state.","");
mystate = mystate.substr(0, 1).toUpperCase() + mystate.substr(1);
mystate


One other answer

Permanent link

Hi there, i'm dealing with the same problem. I want to get my execution results from a specific test case but when i follow your steps, i can't execute it in RPE Launcher (the execution is aborted). I noticed that you did some intermediates step with affectations beteween your datasource configuration but i van't figure out why. Could you explain why ? Or even better, could you share your RPE template so i can read and understand all your steps ?

Regards

0 votes

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
× 332

Question asked: Aug 12 '16, 10:07 a.m.

Question was seen: 3,219 times

Last updated: Jun 27 '18, 4:31 a.m.

Confirmation Cancel Confirm