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

Problems with integrate Selenium+TestRail


Hello all,

I’m trying to integrate TestRail with automatic functional tests testRail and therefore I have a request for help because I’m doing something like that the first time.
I have done the integration and now if I run the tests I save my results in testRail.

I would like to identify the test case in the testRail by idCase in my automatic tests case.
At the moment I am forced to enter idRun + idCase But idRun can be different every time. (screen2)

  1. Do you have any suggestions?
  2. How to send idRun and all idCase contained in it after pressing the button to start automatic tests?
  3. What should be placed in the UI script to run the tests after clicking the start automatic tests button?

I’m drew a picture of the architecture I want to do. screen.



If I understand what you want to do - you want Test Rail to kick off the test in Selenium with a button in Test Rail - correct?

If that is correct - technically you might be able to get that to work however, that is not what Test Rail is designed to do. The more correct way to integrate Test Rail is to run the test(s) in Selenium and then update the test results in Test Rail via the API.


First of all you should understand what there are tests in a test run but not cases. These are different objects with different IDs.

I the best way for you, it’s to send only run ID to your code on test framework side. Then you should get the list of tests of the test run (jast call methed get_tests by testrail api) and you will get all information you need to execute tests (each test contain the correspondent case ID, so you can find your selenium test by this ID) and save result back into testrail (just call add_result method by api).