From what I can tell the docs recommend issuing a 'Ctrl-C' to abort an execution of a '.robot' file (test case/suite). I was wondering if there was a way to add a cleanup mechanism whenever this 'Ctrl-C' is issued? If not, can you suggest which robot api libraries I can use to enhance?
If you stop execution using control-c from the console, robot will still run your teardown commands.
From the user guide:
The execution is stopped when Ctrl-C is pressed in the console where the tests are running. ... By default teardowns of the tests and suites that have been started are executed even if the test execution is stopped using one of the methods above. This allows clean-up activities to be run regardless how execution ends.