0
votes

Is there any way I can stop the whole robot test execution with PASS status? For some specific reasons, I need to stop the whole test but still get a GREEN report.

Currently I am using FATAL ERROR which will raise a assertion error and return FAIL to report. I was trying to create a user keyword to do this, but I am not really familiar with the robot error handling process, could anyone help?

There's an attribute ROBOT_EXIT_ON_FAILURE in BuiltIn.py, and I am thinking about to create another attribute like ROBOT_EXIT_ON_SUCCESS, but have no idea how to.

Environment: robotframework==3.0.2 with Python 3.6.5

2
Can you elaborate on why you want to implement this approach as I can't think of a reason why this behaviour would be desirable. Perhaps there is an alternative path we can suggest to achieve your goal. - A. Kootstra
I am designing a multiprocessing deployment with dynamic arguments on Robotframework. Each process is an independent test execution, if any of the passing argument is invalid or not given while initializing (suite setup), I will skip the execution by FATAL ERROR so it won't continue doing any work then. However the multiprocessing result are all presented in the a single robot report, therefore I need those "not given" argument test result PASS along with those "valid" argument test status. So the report status is trustable. - Timmy Lin
To be frank I'm still not sure I fully understand your setup especially when faulty scenario's are artificially painted green. That to me sounds like you're not in control of the application. If the System under test is not behaving exactly as expected, you should be very wary of the achieved test results, even the green ones. However, it sounds to me that you want to achieve this is to go to custom Python. - A. Kootstra
@A.Kootstra Thanks, it's a complicated test scenario that I cannot really explain well enough. I finally figure out a way to make my report GREEN as I expect by using build-in keywords. - Timmy Lin

2 Answers

2
votes

There is nothing built-in to support this. By design, a fatal error will cause all remaining tests and suites to have a FAIL status.

Just about your only choice is to write a keyword that sets a global variable, and then have every test include a setup that uses pass execution if to skip the test if the flag is set.

0
votes

If I understood you correctly, you need to pass the test execution forcefully and return green status for that test, is that right? You have a built in keyword "Pass Execution" for that. Did you try using that?