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

API to get list of all Test Runs assigned to a specific Test Plan


#1

Hello,
I am looking for an API, that will give me a list of all Test Runs assigned to a specific Test Plan. Something like GET index.php?/api/v2/get_runs/:plan_id. So far I was able to find only these:

  • GET index.php?/api/v2/get_runs/:project_id (but that works only on Test Runs that are not part of Test Plan)
  • GET index.php?/api/v2/get_plans/:project_id (but that returns only the plans, and I need to get one level deeper)
    Our structure of tests is Project > Test Plan > Test Run, so without this I am a bit lost. Any ideas please?

#2

Hi Michal,

Thanks for your posting. You can simply use get_plan for this and this returns all test runs/configurations etc. for a test plan:

http://docs.gurock.com/testrail-api2/reference-plans

I hope this helps!

Cheers,
Tobias


#3

hello tobias,Can you please look into TestRail API Parameter Issue


#4

Hello ,
I am trying to add test result into testRail using java + TestNG .
and I am successfully done that but some how i am not able to give proper value in actual result and content .
below is my code

Map data = new HashMap();
data.put(“case_id”, new Integer(36540));
data.put(“status_id”, new Integer(1));
data.put(“expected”, expected);
data.put(“elapsed”, “5m”);
data.put(“title”, title);
data.put(“custom_date”,“12/20/2016”);
data.put(“actual”, “Login Passed”);
data.put(“content”,content);

List list = new ArrayList();
list.add(data);
Map d = new HashMap();
d.put(“results”, list);

client.sendPost(“add_results_for_cases/347”, d);

I am able to mark the test case as pass but not able to add actual result and contect parameter …


#5

Hi Dhaval,

Please see: TestRail API Parameter Issue

Cheers,
Tobias