Execution Result of a Test Case
Accepted answer
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".
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!
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
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