I have a keyword implemented with Java and if keyword fails i need to stop the whole test execution with message: "ERROR: example message".
Raising exceptions is the officially recommended way.
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#reporting-keyword-status
Java (as there in the comment to accepted answer)
throw new AssertionError("ERROR: example message")
Python
from exceptions import AssertionError
.
.
.
def rftest(self):
test_result = lib.runtest()
if (0 != test_result ):
raise AssertionError("Test Failed")
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