Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

How do I retrieve the test runs for a given Test Plan using Python API

#1

For Given Test Plan which is mapped to Milestone. I need to get list of test runs for a given Test Plan. Currently I get cumulative test pass and fail for a given Test Plan( which internally may have many Test Runs)

Can retrive all the test runs for a given Test Plan by using python API?

0 Likes

#2

You want to use get_plan. You specify the test plan ID in the request and it returns all the information about the test plan. The return format below get_plan will show you the data about the test plan it will return.

I don’t use the python API, but I think the request would look like this.
case = client.send_get(‘get_plan/plan_id_here’)

1 Like

#3

I considered this option, But none of the Test Plan API’s return list of Test Runs under it as part of Response Code. I have to manually look at the Test Runs under a Test Plan and then use the API mentioned above.

0 Likes

#4

Hi Nagaraj,

As @NateVolt mentions, the get_plan method would return the IDs of any test runs contained inside. These IDs are inside the response as follows:

{
    "assignedto_id": null,
    ....,
    "entries": [
    {
	....,
	"runs": [
	{
                ....,
                "id": 81,
                ....
}]}]}

The get_plan method response contains the “entries” array. Inside the “entries” array are “runs” arrays which will contain the IDs of the runs you seek. You can also review a more in-depth sample response in our API documentation for this method.

Hope this helps,
Jon

0 Likes

#5

Sorry for the late reply

Thanks for the help. It works fine.

0 Likes