Forum Discussion

nisgupta's avatar
nisgupta
Valued Contributor
6 years ago

Report do not contain error informa. Only the log before the error occurs using the Log.SaveResultsA

Here is the case

we use Log.SaveResultsAs  to export the log in MHT format.

 

We stop the script as soon as the error occurs and thus export the log but it display the log before error .

Attached the screenshot.

 

Please update 

Thanks

NG

 

11 Replies

  • nisgupta's avatar
    nisgupta
    Valued Contributor

    Also attached the exportLog() implementation.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      What you have described is correct behavior.  Basically, the OnLogError event handler interrupts that act of logging the error.  The error is not written to the log until the event handler exits.  This is to allow the event handler to make any necessary modifciations to the error (or skip it entirely) before it is written to the log.  

       

      Rather than the SaveResultsAs going into that event handler, I'd actually put it in the OnStopTest event handler.

      • nisgupta's avatar
        nisgupta
        Valued Contributor

        tristaanogre

         

        Thank you for the updates 

         

        If we look at the screenshot we are putting the SaveResultsAs into OnStopTest event handler I am calling the function exportlog which is in in the OnStopTest event.

         

        Then also we are having the issues.

         

        Thanks

        NG