Forum Discussion

gus's avatar
gus
Contributor
9 years ago

Log saved in OnStopTest event missing latest errors

Hi,

 

I have created an OnStopTest event handler to be able to send email notification for prematurely terminated tests, such as when a tested app cannot be launched and the such.

 

In my event handler, I save the log to an MHT, zip the MHT, and send an email with the ZIP file attached. Now my problem is that the MHT file does not contain the error events causing the tests to terminate, that is, exactly those few entries are missing which would be relevant. Taking a look at TestComplete's native log, I realized that the errors are logged only after the event handler completes. (I know this because the mail sending routing logs a message to the log upon successful mail sending, and the entries for the terminating errors appear below this.)

 

Is there a way to save a version of the log which contains the errors causing execution to terminate?

 

I've attached a screenshot to explain more clearly what is contained in the MHT and what I'm missing badly.

2 Replies

    • gus's avatar
      gus
      Contributor

      Hi Joseph,

       

      Thanks for the reply. Yes, I use SaveResultsAs, and it saves the log correctly, but without the error entries which cause the event to be triggered. It's like those events would be logged after the event handler completes.