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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top