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

Referencing Test Cases within a new Test Run

I am currently using the TestRail API to create a new Test Run every time I execute my automated test suite.

How can my automation code reference the test case numbers within the test run (to add pass/fail results) when there are new test case numbers generated each time a run is created?

Please help.

Hi Andrew,

Thanks for the post! When submitting results to a test run via the API, you can use the add_results_for_cases and add_result_for_case API methods which would allow you to use the test case IDs from your project’s repository in conjunction with the new test run ID.

The test case IDs within the project would remain static with each test run, so this method would allow you to submit results to the test inside the run corresponding to case from your project without needing to determine the test ID beforehand.

I hope this helps,

Excactly what I was looking for - thanks!