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

Any API to get the count of test cases/results/sections/runs

Hi Team,

Do we have any TestRail endpoint which will give us the count based on the subsection in a given suite.
Or counts of the total test results passed/failed/skipped in a given test test run

Any information on the above counts related endpoints will definitely helpful to me. I explored the TestRail API Documentation but no luck.

Do any of these user-submitted scripts help?

Hi Magate,

Thank you so much for your reply. I went through those scripts already, i dont think that those scripts are much of help. Looking for more flexibility and options from the TestRail API, there is no direct endpoint like /get_runs/count or get_cases/count etc.

How to add a new test case id to the existing Test Run, it should be like adding a new test case to the existing list of test cases in a run, where as the current api update_run is just replacing.

Appreciate if you can help me to get answer to the above question.

Hi @Ramakrishna,
afaik there is no endpoint for it.

Of course you can get all cases of a section in a suite and count them (or get all results from a test run filtered by a state) if you accept the traffic overhead because you don’t need al the data.

It sounds silly, but I wasn’t able to find an alternative in the past, if you don’t have direct access to the db, what is usually the case.