Ghasfarost
Ghasfarost

Reputation: 782

How to stop RobotFramework test if using Programmatic Java API?

I am considering integrating RobotFramework inside a JSF application in order to run test from a frontend using the RobotFramework's programmatinc Java API. I know it currently supports only running tests, but do you think there is a possible way to allow the user to cancel the execution of a running test?

Upvotes: 0

Views: 444

Answers (1)

janne
janne

Reputation: 1017

The Java API itself does not allow stopping the test execution. In fact, the command line runners do not have this capability either. Using signals is the best way, because when stopped by signal, reports and logs are still generated: http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7.6#stopping-test-execution-gracefully.

Another option would be using the listener interface ( http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7.6#using-listener-interface ), and calling sys.exit() in a listener. In this case, there's no way to get reports or logs of the test run.

Upvotes: 1

Related Questions