I am looking for help from community for one of My project tricky requirement given below.
Is there any way we can create/generate separate log.html,Report.html for each scenario & also generate a consolidated report post all execution done.
Eg: TestFile.robot
Test Cases
Scenario 1: Test case execution1
Scenario 2: Test case execution2
Scenario 3: Test case execution3
Once execution started , we should get reports as below.
–Report one(Scenario 1)
-------log.html
-------report.html
-------Screenshots.
–Report two(Scenario 2)
-------log.html
-------report.html
-------Screenshots.
–Report three(Scenario 3)
-------log.html
-------report.html
-------Screenshots.
If you plan to execute all your suite/file with one robot command, the .xml and related files will be generated only at the end.
So a solution is to use rebot once execution is done to generate/split each report. For example based on test names or a tags you can add on each test.
If you really need each file during execution:
Either run each test from a separate robot command, then rebot --merge your files
Or maybe use a listener to write real-time xml file but not sure about the possibilities.
Thanks @CharlieScene can you please help me with reboot command syntax which will help me to generate/split reports post all execution based on scenario/test name.
I have tried below one but no success
Command:rebot --splitlog --outputdir ./logs --reportname scenario_%{SCENARIO_NAME}.html --logtitle “Scenario Log: %{SCENARIO_NAME}” output.xml
if one runs rebot --help - there’s following example:
# Using options. Note that this is one long command split into multiple lines.
$ rebot --log smoke_log.html --report smoke_report.html --include smoke
--ReportTitle "Smoke Tests" --ReportBackground green:yellow:red
--TagStatCombine tag1ANDtag2 path/to/myoutput.xml
That sort of hints towards that you need to have unique tags for split.
So, add a uniq tag for each testcase and then run rebot for each tag against the original output.xml. eg, its the --include smoke that will add only tests/suites that have smoke as tag that will be included in the new report.