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

Passing current test_id to automation script(s)


I am new to TestRail and looking through docs etc. was unable to find answer. Is it possible for a test to send its current test_id as a parameter to automation environment?


Hi Ajay,

Thank you for posting! You can integrate TestRail with basically any test automation tool by using TestRail’s API. We do not currently have ready-to-use scripts for specific test automation tools, but many of our customers use TestRail together with various test automation tools and frameworks. We also offer basic API bindings for various programming languages such as Java, .NET, Python, Ruby, PHP etc. You can learn more about the API on our website here:

There are two different API methods that allow users to add a result to a test. The ‘add_result’ API method requires the test ID while the the ‘add_result_for_case’ method uses the test run and parent test case combination to determine the test to add the result to. This means the ‘add_result_for_case’ method expects the run ID and the case ID. It’s also possible to add results in bulk using either the test IDs or the run IDs and case IDs. You can also find more information about adding results on our website here:

I hope this helps!