Retriggered Failed Test Cases In Robot Framework
Step-by-Step Guide to Re-Triggered Failed Test Cases in Robot Framework:
Step 1: Before re-running any failed tests, it's essential to obtain an initial set of test results. You can do this by executing your test suite as normal, which will produce an output file (output.xml), a log file (log.html), and a report file (report.html).
Command:
robot --output output.xml path/to/your/test/suite
E.g.: robot --output output.xml .\Tests_Regression\02_Browse.robot
Step 2: Identifying Failed Tests
Once the initial test run is complete, review the report.html or log.html files to pinpoint the failed test cases. These files contain detailed information about the status of each test, highlighting any failures.
Step 3: Re-running Failed Tests To re-Triggered only the failed test cases, Robot Framework offers the
--rerunfailed option. This option reads the previous output file and re-executes only the tests that failed.
Command:
robot --rerunfailed output.xml --output rerun_output.xml path/to/your/test/suite
E.g.: robot --rerunfailed output.xml --output rerun_output.xml .\Tests_Regression\02_Browse.robot
Step 4: Merging Results
After re-running the failed tests, you'll have two sets of results: one from the initial run and one from the re-run. To obtain a comprehensive overview, combine these results using the rebot tool.
Command:
rebot --output final_output.xml --merge output.xml rerun_output.xml
Step 5: Analyzing the Final Results
Open final_output.xml using Robot Framework's log viewer, or review the corresponding report.html and log.html files to view the combined results from both runs. This will indicate which tests still failed and which ones passed after the re-run.