Sometimes correctly written test cases can fail in robot framework. This could be caused by a couple of reasons including but not limited to:
- Network failures - leading to a time out
- Software failures
In such a case, there arises a need to rerun only the failed test cases and generate a report that combines the results. Sit tight as I guide you on how to do this (and become a master in 4 seconds π)
1. Run Your Tests
Letβs use a simple sample robot project as below. There are 3 test cases in TC1.robot.
After running the tests, assume one test case fails due to a network error as below:
2. Rerun the Failed Test Case
To rerun only the failed test cases, run the command:
robot --rerunfailed output.xml --output output2.xml TC1.robot
output.xml is the output of our first run, while output2.xml is where we want to store the output of our second run.
Only the one failed test case has been run
3. Combine the outputs
To combine the two runs and have a combined report, run the command:
rebot --output output.xml --merge output*.xml
Yehey, βΊοΈ , simple, right?
Top comments (0)