It's all about the answers!

Ask a question

How to set Total Run Time when creating an executionresult via REST API


Jürgen Brückler (69122) | asked Sep 10 '18, 2:21 a.m.
edited Sep 10 '18, 2:21 a.m.

We import test results from an external tool into RQM by using the REST API.

Therefore we create executionresult-records. In these we set startTime and endTime.
I would have expected that Total Run Time will be calculated from the time elapsed between startTime and endTime, but it still shows 0 sec.

Is there a way to set the Total Run Time via REST API or to cause RQM to calculate it from the values of startTime and endTime?

Thank you!
Juergen

Accepted answer


permanent link
Paul Slauenwhite (8.4k12) | answered Sep 10 '18, 6:30 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
The er:totalRunTime property is read-only (see https://jazz.net/products/rational-quality-manager/api-doc-6.0.6/schemas/executionresult_xsd/elements/totalRunTime.html).  It's calculated using the following formula:

er:endTime - er:startTime

Note: The er:totalRunTime property is only populated with both the er:endTime and er:startTime properties are set.
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #4e9072} </style>
Jürgen Brückler selected this answer as the correct answer

One other answer



permanent link
Jürgen Brückler (69122) | answered Sep 10 '18, 7:51 a.m.

Paul, thanks for your response.

Yes, you are right, the totalRunTime will be calculated.
I retrieved the executionresult via GET:
<ns16:starttime>2018-08-06T15:47:42.000Z</ns16:starttime>
<ns16:endtime>2018-08-06T15:51:22.000Z</ns16:endtime>
<ns16:totalRunTime>220000</ns16:totalRunTime>
 
220 sec is calculated correctly - perfect.

When hovering over the result in the Test Case Result Web Browser, the bubble says: 
Start Time: Aug 6, 2018 5:47:42 PM
End Time: Aug 6, 2018 5:51:22 PM
Total Run Time: 3 min 40 sec

BUT:

When I click on this result and display it in the WebClient, startTime and endTime is displayed (as in the bubble), but "Total Run Time" will be shown as "0 sec".

So maybe the problem lies in the Web editor for Test Case Results ...?


Comments
Paul Slauenwhite commented Sep 10 '18, 10:29 a.m. | edited Sep 10 '18, 10:34 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Jürgen Brückler commented Sep 11 '18, 5:21 a.m.

Thanks, Paul!

Here is the link to the defect I've created:
172344: Test Case Result being created via REST API: Total Run Time shows 0 sec ONLY in Web Editor (section "Result Details")

(for documentation purposes... ;-) ) 

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.