How can we stop the execution of test script which are triggered using python scripts

I need to force stop the test case execution through python scripts when it is in running state.
I understand “ctrl+C” does the same thing but I need to do it through python script.
Also, I understand fatal error stop execution.
Is there any library or API I need to call to stop execution?

Hi Shekhar,

  1. If you use subprocess.Popen to launch the robot you can simple use Popen. terminate () to send the equivalent of a “ctrl+C”

  2. Alternatively if you can get the PID of the robot process upi could probably use os.kill() to sent the signal.CTRL_C_EVENT signal

You should be able to get one of them working, rfswarm’s agent uses the 1st method.

Hope that helps,