Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

robotframework : How to ignore failure from --rerunfailed when all tests are passed

I run my robotframework test suite as a teamcity/jenkins build with two simple steps as below

  • build step #1: pybot
  • build step #2: pybot --rerunfailed Results\output.xml

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 ?

like image 200
senram Avatar asked Aug 23 '17 16:08

senram


People also ask

How do you skip test cases in robot framework?

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.

How do you execute only failed test cases in robot framework?

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.

How do you run the same test case multiple times in robot framework?

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.


1 Answers

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.

like image 125
Yogesh Rathod Avatar answered Jan 01 '23 09:01

Yogesh Rathod