Question

I would like to set ROBOT_CONTINUE_ON_FAILURE variable from test framework python libraries. But, it doesn't seem to work at all.

This is what I'm doing -

class TestCaseFailedException(Exception):
    ROBOT_CONTINUE_ON_FAILURE = True

Are there any imports that I need while setting this variable?

Thanks in advance.

Was it helpful?

Solution

one library named 'A.py'

from robot.errors import RemoteError
class A(object):
    def fun(self,var):
        if int(var)>5:
            raise RemoteError('test','test',fatal=True,continuable=True)

one test named ''

*** Test Cases ***
test
  Fun  10
  Log  111

self.ROBOT_EXIT_ON_FAILURE = fatal

self.ROBOT_CONTINUE_ON_FAILURE = continuable

when fatal is 'True', no matter what continuable is,the test will exit at step 'Fun 10'. But if fatal is 'False' and the continuable is 'True',the test will run finished.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top