duncanbrown
14 years agoOccasional Contributor
OnStopTest and exceptions
Hi,
I'm using TestComplete 7 and am trying to put something in place that will send an email notification whenever a test finishes. To do this, I've set up a handler for the OnStopTest event and this works fine in most cases - specifically, it works fine if the test run finishes without any problems, or if execution is terminated due to an error being logged. However, where it falls down is when execution stops due to an exception. In this case, the code in the handler gets executed only after I've closed the exception dialog that TestComplete shows, which rather defeats the point of the automatic emails...if there's no-one around, the dialog will stay on the screen and no email will get sent.
Is there any way around this? Some option that will have TestComplete automatically close the dialog, for example? I know that in many cases the solution would just be to handle the errors in the code, but this won't work for me here due to the problems TestComplete has with handling exceptions across different script units.
Thanks,
Duncan
I'm using TestComplete 7 and am trying to put something in place that will send an email notification whenever a test finishes. To do this, I've set up a handler for the OnStopTest event and this works fine in most cases - specifically, it works fine if the test run finishes without any problems, or if execution is terminated due to an error being logged. However, where it falls down is when execution stops due to an exception. In this case, the code in the handler gets executed only after I've closed the exception dialog that TestComplete shows, which rather defeats the point of the automatic emails...if there's no-one around, the dialog will stay on the screen and no email will get sent.
Is there any way around this? Some option that will have TestComplete automatically close the dialog, for example? I know that in many cases the solution would just be to handle the errors in the code, but this won't work for me here due to the problems TestComplete has with handling exceptions across different script units.
Thanks,
Duncan