Forum Discussion

puyopuy's avatar
puyopuy
Contributor
13 years ago

How to save log after each Run Project

Hi guys,


I want to save TC's log file using Log.SaveResultsAs at the end of Run Project(F5). What event should I use? I'm currently using OnStopTest event but it will save the log file every test is over.  I want to do it at the end of the run project.  Any idea?


Thank you very much for your help in advance.

puyo   

5 Replies

  • jackson_1's avatar
    jackson_1
    Frequent Contributor
    hi,



    i think you can use the log.savereslutas function at the end of your Main Produce in current Project .





  • Thanks for quick reply.



    We actually we don't have main function/procedure .  We execute test cases from TestItems page.



    Is there any event that will trigger before TC close?  I want to save log before TC close.



    Thanks
  • Hi Puyo,


    I recommend that you create a helper routine in your script that will invoke the Log.SaveResultsAs method. Then, create a new project test item at the end of your existing test items hierarchy and specify that helper routine in the Test field there.

  • Thanks Irene, 


    Do you mean to call the helper routine for each Test?  Is there a event similar to OnStopTest but for whole process?

  • Puyo,


    There is no event triggered at the end of the whole project or project suite execution. We have such a request registered in our database.


    To demonstrate my suggestion, I am attaching an image. There, MySaveLogFunction is a helper routine that invokes the Log.SaveResultsAs method. As it is added as the last project test item, it will save the results of the whole project execution.