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

Create new Execution Result in RQM using Rest API

I am also facing similar issue. What we do is we go and create Execution Record for all test cases that needs to be executed on a build. Please note that while creating execution record we don't create the Execution Result, to so initially all the test cases as Not Run. Now We run our Automation framework which executes the test cases and updates the execution result in RQM.

We use rest API to create Execution result.
First issue is while setting the Testplan, Testcase, TestPhase etc. executionResult.setTestcase(testcase)
here it asks for a testcase instance of ...bind.ExecutionResult.Testcase class.
and I am unable to get the reference of this inner class. If I try to get the reference from the Test Execution Record it gives ...bind.Executionworkitem.Testcase
similarly for testplan and Testphase.
If any one can tell how to get reference of testcase, testphase, testplan without using another Execution Result.

Second way What I tried is
Created a Execution Record with using same testplan, testphase and testenvironment
In this case as we know RQM will not create a new Execution record instaed it will create a Execution Result and attach this to same execution record which has all 3 parameters(testplan, testphase, testenvironment) same.
In this case I get an error "Redirect requested but followRedirects is disabled."

I tried to setfollowRedirects on IRQMRestClient but didn't find any method how to do this.
If anyone can help me in any of these 2 issues, it will be highly appreciated.

0 votes



4 answers

Permanent link
1) You need to create a new instance of Executionresult.Testcase and set the properties.  For example:

Executionresult.Testcase jaxbTestcase = new Executionresult.Testcase();
jaxbTestcase.setXXX();

jaxbExecutionresult.setTestCase(jaxbTestcase);

2) You need to disable follow redirects on the HTTP method before execution:

putOrPostHttpMethod.setFollowRedirects(false);

//Execute HTTP method...

To resolve the execution work item URL:

if(putOrPostHttpMethod.getStatusCode() == HttpURLConnection.HTTP_MOVED_TEMP){
    String location = putOrPostHttpMethod.getResponseHeader(HTTP_HEADER_LOCATION).getValue();
}

0 votes

Comments

Thanks Paul for your reply

When I post, it gives error "Test Case Execution Record is not provided" I am unable to get the href of Executionworkitem to do something like this Executionresult.Executionworkitem execResWI = new Executionresult.Executionworkitem(); execResWI.setHref("I need href of Execution record to set here"); executionResult.setExecutionworkitem(execResWI );

I don't have any existing ExecutionResult. I have only Execution record.


Permanent link
I created a new Executionresult.Executionworkitem
created a href based on webId of Executionworkitem that I want to update and set that in newly created Executionresult
after that post the Executionresult
I get Null pointer exception from post method, but execution result is created.
If any one has any idea why Null pointer is coming, which parameter I need to set to remove this.

0 votes


Permanent link
The best practice is the Tip in https://jazz.net/wiki/bin/view/Main/RqmApi#Create after creating a few sample resources in the RQM UI.

You'll need to post the NPE stack trace to determine the cause.

0 votes


Permanent link

 Hi Sudarshan were you able to resolve your issue. If so please provide  sample code. We are alos trying to implement the same feature.


Thanks in advance

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
× 12,020

Question asked: Jun 05 '12, 6:27 a.m.

Question was seen: 8,741 times

Last updated: Jan 09 '18, 1:24 p.m.

Confirmation Cancel Confirm