Forum Discussion

fujunxu's avatar
fujunxu
Contributor
10 years ago

Log.SaveResultsAs didn't save the error message

I use “result = Log.SaveResultsAs(myFilename,2)”  to save log in function “GeneralEvents_OnStopTest”.  When my script fails I couldn’t see the error message.  But if I use command line option /ExportLog: I can see the error message.  It looks like the error message only attached to the log after testexecute finished.  Is there a way to save error log when testexecute is still running?  Thanks.

3 Replies

  • what is the version of your TC?

    i'm using TC10 and it worked.






    function main(){


      Log.Message("Message");


      Sys.Keys("");


      Log.Warning("Warning");


      Log.Error("Error", "Error details");


    }


     


    function GeneralEvents_OnStopTest(Sender)


    {


      Log.SaveResultsAs("C:/temp/log.mht",2)


    }



     

  • what is the version of your TC?

    i'm using TC10 and it worked.






    function main(){


      Log.Message("Message");


      Sys.Keys("");


      Log.Warning("Warning");


      Log.Error("Error", "Error details");


    }


     


    function GeneralEvents_OnStopTest(Sender)


    {


      Log.SaveResultsAs("C:/temp/log.mht",2)


    }



     

  • I also used TC10.  I can save the error log to files.  In my script I save the result log in OnStopTest function.   When TC raised an error I didn't see the error message in my result log.  Even the test is failed in result log it didn't shows the test was failed because no error message got logged.  I do see it under TC IDE.