Pan Borowik
Pan Borowik

Reputation: 1

Is there a way for Robot Framework to detect exceptions within a separate process spawned in Python?

I'm using Robot + Python for testing purposes and currently I have to start separate "actors" of the test case in separate processes (using multiprocessing.Process). The problem is, exceptions (which I would normally use to fail the robot test) raised within the separate process are not visible to Robot. The test just continues without problem. If I call the exception outside of the process, the TC fails just fine. Within - nothing. Is there a way of making these visible to Robot?

Upvotes: 0

Views: 516

Answers (1)

jozefow
jozefow

Reputation: 786

as @Dandekar said, RF is not well suited for multiprocess test execution (parallel execution) however it looks like you could control Robot from actors spawned as separate processes. There is listener API which can provide not only simple reports about execuiton and RF state but also can interact with Robot (at least stop/pause execution). In RED Robot Editor, it is used for debugging (pause/resume/breakpoints), in your case you may try to break execution status when actors are not in proper test state.

have a look: https://github.com/robotframework/robotframework/blob/master/doc/userguide/src/ExtendingRobotFramework/ListenerInterface.rst#modifying-execution-and-results

Upvotes: 1

Related Questions