Forum Discussion

maximojo's avatar
maximojo
Frequent Contributor
9 years ago

Method to incrementally save html log while test is running

Hi all,

 

Just curious if anyone has found a way to incrementally save an html log. By this I mean, while the test is running:

 

- Every e.g. minute, export out to html (we can only use Log.SaveLogAs at the moment) only the log data that has changed since the last save

 

That way I can save it out to a web server and use it as a way to view the test results LIVE.

 

Might be a feature request if no one has any ideas.

 

The reason is that some tests can:

 

- go on for a looong time (we want to know of any errors while it's running and be able to see if any important errors occurred)

- be absolutely HUGE (why we would save incrementally i.e. not save the full log each time)

 

I could probably figure out something myself e.g. On an error event save off my own custom html page to the webserver, but would, ideally, like to use the Smartbear test log.

 

Thanks for your help!

 

m

  • maximojo's avatar
    maximojo
    Frequent Contributor
    Understood. But what would I save out? There are no TC functions I know of to save out the delta of the logs in html.
    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Correct, there is not a function to do a delta... what you would do is a constant "updating" of the existing TestComplete export using the Log.SaveLogAs method.  The effect is still the same: every so many seconds, a timer kicks off and saves the TC log up to that point.

       

      One thing to take a look at...  If you have your tests organized as TestItems in the project, there is an option in the SaveLogAs to only save out the log for the current TestItem.  What you could do then is add code into your routine that does the save to detect when the project moves on to a new test item... when  it does, save a new file. 

      It's not EXACTLY what you want... but it does effectively what you need to.


      • maximojo's avatar
        maximojo
        Frequent Contributor

        The problem is SaveLogAs will save out the ENTIRE log each time. Some of my automation session logs take over 5 minutes to export after TE is done. Therefore towards the end of my test run each LogSaveAs will end up being minutes (if called by the timer).

         

        Thanks, I will look at the test item option though I suspect, unless Smartbear adds it, I will have to come up with my own custom solution. Shouldn't be too hard. Will report it here when I'm done.