A tool for splitting Ranorex reports

Best practices, code snippets for common functionality, examples, and guidelines.
McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

A tool for splitting Ranorex reports

Post by McTurtle » Thu Mar 26, 2020 1:32 pm

Hi all,

I had this requirement to make smaller report files. I rather would not dare to split the test suite because of that. Therefore, I thought I'll see if I can split the actual XML file of the report. I managed to do it by working with the data file. The tool is really small and does not have any dependencies outside of .Net. I'm posting it here.

Copy the tool into the folder where the rxlog file that needs to be split is located and run "RanorexReportSplitter.exe /?" in order to see the required arguments and how to use them. Below is a copy paste of the console output of "/?".

Arguments:


       Mandatory:


  ---> '/inReportName'  : The name of the input Ranorex report file in format '/inReportName:<name>.rxlog'.


  ---> '/outReportName' : The name of the output Ranorex report file in format '/outReportName:<name>.rxlog'.


                          SplitType 'Half' will prepend '1_' and '2_' to the name you set.


                          SplitType 'ListedAndRest' will prepend 'Rest_' to the report file
                          with the containers that were not in the list.


                          SplitType 'OneReportPerTestContainer' will ignore this argument
                          and use test container names instead.


                          SplitType 'SplitAt' will prepend '1_' and '2_' to the name you set.


  ---> '/SplitType'     : The type of split to use in format '/SplitType:<SplitType>'.


                          'ExtractListed' will create one report that contains only the test cases listed.


                          'Half' will create two reports with half of the test cases each.


                          'ListedAndRest' will create one report with the test containers
                          from the list and one report with the rest.


                          'SplitAt' Splitting report into one holding the test containers up to the listed test container
                          and one holding the rest of the containers. If 'List.txt' is passed, the 1st container will be considered.
                          If multiple test containers are passed via argument, the 1st will be considered.


                          'OneReportPerTestContainer' create as many reports as there are root test containers.
                          and use test container names instead.


  ---> '/List'          : The list of test containers that the splitter should consider in format '/List:<name>,<name>,<name>,...'


                          The list will be ignored by SplitType 'Half' and SplitType 'OneReportPerTestContainer'


                          If there is a file with the name 'List.txt' in the same folder together with the splitter
                          and the file contains at least the name of one root test container, then the content of the file
                          will be taken and the splitter will not ask you to input the list of root test containers.


       Optional:


  ---> '/DontRecalculateHeader'


                       : This flag can be activated by adding '/DontRecalculateHeader' after the exe.
                         By default the dirations, failures, successes and ignores will be recalculated.
                         If this flag is used, then the original header will be kept.

If you have any ideas for great improvements that would be easy to implement, just let me know and I will MAYBE someday find the time to implement them.

Also, I am the only one who has ever used this tool :) Could be it will not work for you for some reason I simply did not think about, so let me know that too. I did not actually build a test for it :D

And last... There are some important limitations:
1. The tool does not work correctly if you use multiple test cases with the same name.
2. The tool only works in root level of report. So... If you are trying to split deeper inside the tree, then this wont work. I just did not manage to make the merging of xml trees work deeper than at the root.

I hope this will help someone.

Regards,
McTurtle
Attachments
RanorexReportSplitter.7z
(12.43 KiB) Downloaded 4 times