How to generate a separate log file for each test?

My test framework has following flow:

CSV File (Each row contains parameters a different test scenario)
|-> The .robot file uses datadriver Library to parse the CSV
|-> The robot file contains the test flow and invokes related python code using keywords

The robot file is run and all the test scenario defined in CSV get executed w.r.t to parameters defined in each row.
At the end of test suite we get a output.xml, log.html, report.html

The logs and reports contain consolidated data of the test suite.
But I would like to generate a separate log and report file for each test scenario defined in the CSV.

How this can be achieved?

Please note: I do not want to create multiple robot files for each test case

Hi Shubham,

after running the test and getting the output.xml, you could try using rebot with the -t option, something like:

rebot -t "your test name" -o "your test name output.xml" output.xml

If that does what you need then repeat for each test you want as a separate file. You can direct these outputs to different directories etc, see the rebot help for more options.

Dave.

1 Like