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

Experience with integrating Test Automation Tool (e.g. Ranorex)?


#1

has anyone gained some experience in integrating TestRail with test automation tools ?
e.g. Ranorex ? This seems to be pretty straight forward (like testrail), but can it be integrated with TestRail ?

Any other tool sugestions, to support automted test in combination with TestRail ?


#2

Hello,

Thanks for your posting. We don’t have any examples on how to integrate Ranorex with TestRail currently. You would usually integrate automated tests by leveraging TestRail’s API (mostly to submit test results):

http://docs.gurock.com/testrail-api2/start
http://docs.gurock.com/testrail-api2/reference-results#add_result

We also have an example on how to trigger tests directly from TestRail:

http://docs.gurock.com/testrail-custom/automation-trigger

It is also planned to provide examples for the most popular automation tools but this is not yet available.

Regards,
Tobias


#3

Hi Tobias,

Any new updates to this item?
Is there a how to on “TestRail integrate with Ranorex”?

Regards,
Luvs


#4

Hi Luvs,

Thanks for your posting! We currently don’t have a specific example for Ranorex but we usually recommend running external tools outside of TestRail and then submitting the test results via TestRail’s API:

http://docs.gurock.com/testrail-api2/start

It’s also planned to add more examples and integrations for automation tools in the future.

Cheers,
Tobias


#5

Thanks Tobias for this reply.

I was able to download the sample API for dotnet and compile it with no issue.

.

My question now is how I can use this API?
Do I need to put this dll file somewhere?

Regards,
Luvim


#6

Hi Luvim,

The binding is just a library and you would need to add this library to an application/executable (e.g. a command line tool). An example can be found here:

http://docs.gurock.com/testrail-api2/bindings-dotnet

The easiest way to use the library is to use the Visual Studio project file and add this to a standard project/Visual Studio solution.

Cheers,
Tobias


#7

Hi Tobias,

Sorry for asking too many questions(This is the first time I do this).
I don’t quite understand in your example how “https://{Your Domain}/testrail/” will get connected to the API and use it by issuing a command something like this.

https://{Your Domain}/testrail/api/v2/get_case/4.

I was able compile the sample code(dotnet) but I can’t connect it to they testrail website.

Thanks,
Luvim


#8

Hi Luvim,

Thanks for your reply and I’m happy to help! You only need to pass your TestRail address to the API client and the binding will take care of formatting the API method addresses etc. This looks as follows:

APIClient client = new APIClient("http://<server>/testrail/");
client.User = "..";
client.Password = "..";
.. = client.SendGet('get_case/4');

If you are using a TestRail Cloud instance, the TestRail address would be https://example.testrail.net/, for example (with example replaced with your actual instance address). For local TestRail installations, you often access TestRail via http://<server>/testrail/, hence the additional /testrail/ at the end of the example URL.

I hope this helps!

Cheers,
Tobias


#9

Thanks Tobias… Really appreciate this input!

So after I created and build the project. How do I deploy this library?

Regards,
Luvim


#10

Hello Luvim,

Thanks for your reply! You would usually reference the project in Visual Studio from your solution/project and can then use the provided classes (after adding the namespace to your using section). Regarding the deployment: you can simply include the generated DLL as part of your regular deployment process or integrate the source code into your build process.

Cheers,
Tobias


#11

I just created the integration of Ranorex and TestRail.

I included the Ranorex dll as Reference in the Ranorex (plus the JSON library the API is mentioning). Then I created a C# file in Ranorex and added the code as mentioned by Tobias to push Ranorex results to TestRail.

I added this file as part of each test case, so that it is executed, when Ranorex finishes the test case.

As precondition to this - each test case in Ranorex must define as parameter the id of the TestRail test case. So ideally you have a 1:1 relation between test cases in Ranorex and TestRail.

Furthermore the test suite in Ranorex must define as parameter the run id from TestRail.

I start now a test suite from command line with the current run id, Ranorex executes the test cases and sends results then via the TestRail API to the TestRail cloud.


#12

That’s great to hear and thanks for sharing this! This approach of linking the TestRail test case IDs to your automated tests is also the approach we recommend. This makes it very easy to create test runs (via add_run or add_plan) and then add results via add_results_for_case.

Thanks again!

Cheers,
Tobias