1

I've got Selenium automation tests using C# with xUnit test framework. When the tests are run the results are generated into a xUnit standard XML file. I am looking at the ways to somehow import the results from XML file into the TestRail so that I have a central repo for all test runs and I can generate meaningful reports inside TestRail.

I know there's an API I can use but creating methods inside the tests to post each test result is looking very cumbersome. Instead it would be really great if I can import the XML file into TestRail.

Please help.

Dinesh Kumar
  • 1,694
  • 15
  • 22

3 Answers3

1

Hi as I know there is no direct importer for XML to Testrail. But if you look on GitHub there are is a Testrail client which you can use. You don´t need to implement a new one.

https://github.com/zoosk/testrail-client

Direct import of XML will lead in many cases to a lot of problems. If you use a client for report results you can avoid problems.

Additional you can have a look at Test Rail's API

There are some mentioned examples for C#.

SlightlyKosumi
  • 701
  • 2
  • 8
  • 24
Robert
  • 11
  • 2
1

I did it for my current company. We used Xunit 2.1 and C#. Once the report is generated, I created a Xml parser that will store the results in a dictionary and send the results to the testrail API.

We created a Add cases function to firstly create the TC and bulk upload results once the report is generated.

You can information about the testRail API there:

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

Dinesh Kumar
  • 1,694
  • 15
  • 22
Raja
  • 46
  • 1
  • 8
0

Adding a new answer to help future visitors.

You can use the TRCLI (TestRail CLI) to achieve this now. TestRail has recently (in 2022) released their CLI which can help you import your results.xml file into TestRail effortlessly.

Reference - https://support.testrail.com/hc/en-us/articles/7146548750868-Overview-and-installation#Overview

This will help in reducing usage of extra API calls and you can get rid of all those extra lines of code.