How to create your own logs using rebot command

I am executing a set of test cases using a robot framework like this:

pybot -o output1.xml -l log1.html -r report1.html  testsuite.robot

      

this will create an output XML file along with report and log files respectively in my directory.

Now let's consider if there are 10 test cases in the above set and of which 8 are passed and 2 are fail. I will restart these test cases using the following command:

pybot --rerunfailed  -o output2.xml -l log2.html -r report2.html  testsuite.robot

      

I will get two xmls and then I want to concatenate them and get the final xml file as output1.xml along with new log and report files using the following command:

rebot --merge output1.xml output2.xml

      

It worries me that we get log.html

and report.html

. But instead of these default files, I can get my customized logs with whatever name I give? as below

rebot --merge output1.xml output2.xml -l Final_Log.html -r Final_Report.html

      

Can anyone help me how can I get custom name logs after merging two xml files?

+3


source to share


2 answers


I reworked the question. Thanks to Goralight for giving me an idea of โ€‹โ€‹setting up the xml, log and report files.

Let's start.

pybot -o output1.xml -l log1.html -r report1.html testsuite.robot

pybot --rerunfailed  -o output2.xml -l log2.html -r report2.html  testsuite.robot

      

After that, I had to merge these two xml files. I need a new xml file, log file and report file respectively. So, with the help of Gorlight's result and my further research, I got the following solution, which I'm pretty sure of.



rebot --merge --output Final_output.xml -l Final_log.html -r  final_report.xml output1.xml output2.xml

      

This gave me the following three files

Final_output.xml, Final_log.html and final_report.xml

Finally, this is what I wanted. Not. This I integrated with Jenkins Reporter and filled in final result / failure.

Thanks for the help.

+5


source


You don't need it --merge

.

If you want to merge two logs together use this command.

rebot -N TwoCombinedTests --outputdir C:/Path/Where/You/Want/To/Save Test1.xml Test2.xml

      

This will combine 2 test xmls for you with names Test1

and Test2

. In the path you provided with the parameter --outputdir

and with the final name TwoCombinedTests

, thanks to the command -N

.

Note; of course you will need to be in the current directory where this XML file is stored. If using the terminal is just simple cd /path/to/xmls

enough.

Edit - in my case, when I run my tests (about 6 robots files), it will generate 6 from each file (report, log output), each with its own name (test name along with build / sprint number.) I would then throw these names into the sprint and combine them all. Here is an example script I'm using for you to understand what the repo is for (without too much thinking what it is)

# command to combine all the reports into one large report.
os.system('rebot -N AllCombinedTests-' + SprintSlash + '-' + Build + ' '
          '--outputdir C:/AutomationLogs/' + Product + '/Combined/'
          + Version + Sprint + Build + " " + TotalXml)

      

Where TotalXml is a string listing of all found XML.



Edit2:

rebot --merge --name ExampleName original.xml merged.xml

      

This rebot will merge the two xmls outputs for you (original.xml and merged.xml) named ExampleName

From here you will have a large "output XML file" that you can simply rerun to generate a report / log from it

rebot -N NameThatYouWant ExampleName.xml

      

This will use the newly generated XML along with the name "NameThatYouWant"

Any questions please inquire.

+4


source







All Articles