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

Counting Previously Passed/Failed tests

Hello, Thank you so much for the help,
I was trying to figure out how do I count the number of previously passed or previously failed tests using test rail API in python? I used get_results_for_run() but it only returns 250 results(The test run has 6k+ tests), the get_results_for_run()'s description says the limit of 250 can be changed by using limit /offset parameters but I am not sure how do I do it.
Any response is much appreciated.
Thank you so much.

Hi Swapnil,

Thanks for the post! When using a filter on an API request, you would append &{filter_name}={value} to your API request. For example, to retrieve the 2nd set of 250 results for a test run with ID 1, you would submit the following GET request:

https://example.testrail.io/index.php?/api/v2/get_results_for_run/1&offset=251

I hope this helps,
Jon