GeneralEvents_OnStopTest(Sender) - differentiate manual stop from others
Hi,
In order to perform some actions when ending a test, I use the classic function GeneralEvents_OnStopTest(Sender) linked to the OnStopTest event.
I would like to have a different behavior when I manually stop a test (using the STOP button) than when a test closes for another reason. More particularly when a test ended, I check for remaining processes and kill them if exist, that's I would like to avoid when stopping test manually.
I didn't find a way to discriminate between the two situations.
First I was looking to check some properties of the Sender object but this one is always "undefined".
In another hand, as an error labelled "Script execution was interrupted." is added to the Log when a test is manually stopped, I've also tried to check for the "Script execution was interrupted." message in the GeneralEvents_OnLogError(Sender, LogParams) method, but this method is not called when the test is manually stopped.
Is there a reason why Sender is always undefined ?
Is there a way to find when test is stopped manually ?
Thanks for your help,
Best,
Christophe
I use TC 9.0.1069.7 (and can't upgrade for compatibility reason) and script are in C#Script.