It's all about the answers!

Ask a question

REST API - show last execution result for Test Cases in a Test Plan

henry barber (367) | asked Apr 23 '15, 1:00 a.m.
I'm struggling with the XML and URI bits.
I know how to get the Test Cases from a Test Plan (4 in this instance)

and I can scrape the Test Cases from there.
And I know how to show all the execution results with executionrecord and executionworkitem
but not how to show the last result (pass/fail) from all the Test Cases in a particular Test Plan.

I've looked through here and see all the bits I want, but not how to align the planets

3 answers

permanent link
Donald Nong (14.5k414) | answered Apr 23 '15, 6:40 a.m.
 https://<server>:<port>/qm/service/<project>/executionresult?fields=feed/entry/content/executionresult/(*|testplan[@href="<test plan resource uri>"])&sort=descending
Use "testplan[@href="resource uri"]" for filtering and "sort=descending" for sorting. The first entry in the feed is what you want.

permanent link
henry barber (367) | answered Apr 30 '15, 11:11 p.m.
many thanks for the reply.
I've got myself a bit muddled. Apologies for the bold
I've enclosed the whole request in single quotes, as I kept getting Shell errors (due to the &" ? etc)
-url 'https://<URL>/qm/service/<Project>/executionresult?fields=feed/entry/content/executionresult/(*|testplan[@href="https://<URL>/qm/service/<Project>/testplan/""resource="" uri="//<URL>/qm/service/<Project>/testcase/2122487536">"])&sort=descending '
more questions.
The fields=feed/entry/content/executionresult does what? I guessed (incorrectly)
I think I've misunderstood what the resource= and and uri= functionality
the XML I've got shows all the Test Cases in the Test Plan (4), but all I want is the last pass/fail result and when the test was last run , for each Test Case.


Donald Nong commented May 01 '15, 12:13 a.m.

You use the "fields" parameter to do filtering. Read the document carefully. A feed with sorting is the closest thing you can get as far as I know. You have to filter the feed to get what you want. The sorting should make this part a bit easier.

permanent link
henry barber (367) | answered Apr 30 '15, 11:24 p.m.
Oh , and how do I tell the utility to show all the objects when I run it, I seem to only get the first 30 or so?


Donald Nong commented May 01 '15, 6:04 a.m.

The feed is paginated, with each page displaying a predefined number of entries. Look forĀ <link rel="next" href="..." / > for the link to the next page.

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.