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

How to integrate TestRail with Selenium WebDriver


How to integrate TestRail with Selenium WebDriver

Is there any specific API for this ?


Test Rail includes a generic API that can be used by most tools:


Hey Manjunath,

Thank you for the post. As BGanger stated, you can integrate TestRail with basically any test automation tool and many of our customers integrate their automated tests. You would integrate test automation tools by using TestRail’s API. You can learn more about the API on our website here:

While we don’t currently have ready-to-use scripts for specific test automation tools, many of our customers use TestRail together with various test automation tools and frameworks such as Selenium, JUnit, Cucumber, many commercial tools, CI tools like Jenkins etc. It’s also planned to offer more example scripts in the future. We also offer basic API bindings for various programming languages such as Java, .NET, Python, Ruby, PHP etc. via the above link. You might also find this article interesting with details of how other companies like the BBC integrate their automated tests with TestRail:

Selenium Testrail integration


The basic idea is that you need to be able to link your results back to the unique Test ID in TestRail, within the context of a given User. This can be done either as each test is executed and passes / fails, or after the entire run is complete.

If you want to push the results to TestRail after each test passes / fails, you would either create a TestNG listener which will listen for test results and then call the API to submit the result to TestRail. This approach is much cleaner than adding a function to each test.

If you want to push the results to TestRail after the run is completed, you may have to write a parser to read / process the entire results file and then call the TestRail APIs appropriately.

You ca find more info with code here