I run my robotframework test suite as a teamcity/jenkins build with two simple steps as below
When all the tests in step-1 are passed, the build fails because step-2 (--rerunfailed) triggers an error ( [ ERROR ] Collecting failed tests from 'Results\output.xml' failed: All tests passed.) .
Could someone please suggest how to ignore or overcome this error, so that I can show the build as passed in this case ?
If you used Pass Execution to skip your tests, you can pass an optional SKIP tag at the end so that the case will be tagged as SKIP in the log/report. Eg: Pass Execution Skipping this test SKIP. Here SKIP is the tag that will be added to this test case and it will show up in your log/report as a tag.
This can be accomplished by selecting test cases by names (--test and --suite options), tags (--include and --exclude), or by previous status (--rerunfailed or --rerunfailedsuites). the option --rerunfailedsuites reruns the entire suite, not just the test.
For example, if you are running tests on the current folder, you can pass "." as many times as you want the test to run. Ex: robot -t "*My test*" . . . This command will run all tests that match the expression 3 times, and the report will contain all 3 executions and results.
I had similar Problem, i fixed it this way:
robot -d %ResultPath% %TestSuitName% || robot --rerunfailed output.xml --output output1.xml -l log.html -r report.html TestSuitName || rebot --rerunmerge --output output.xml -l log.html -r report.html output.xml output1.xml
Uses ||
to run those command simultaneously and it will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With