How to stop the execution of TestCase and Testsuite and TestSuitCollection using script

My solution to this years-old problem: