How to stop test execution in Robot Framework using keywords implemented using Java?

I have a keyword implemented using Java, and if the keyword is missing, I need to stop the entire test with the message: "ERROR: sample message."

+5
source share
3 answers

Take a look at the user guide in the Status section of the key state report :

You can exclude any exception from the keyword method. The type of exception will be used as a prefix, and you can also add a message.

-1
source

The exception is official recommendations.

http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#reporting-keyword-status

Java ( )

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")
+2

:

  • :

Library         Dialogs
(....)
pause execution     myMessage

, OK. , , java , .

: java-, . JVM . , jvm, robot.

0

All Articles