Forum Discussion

jr348's avatar
jr348
Contributor
4 years ago

Creating a secondary log

Does anyone know if it is possible to create a secondary log in addition to the one TestComplete uses by default?

 

So in tests we could write to this message related to some application parameters and states so they are not buried in the detail of the main log.  This would be supplied to non-technical people.

 

So in the test we would have something  like:

 

Log_Message_Secondary_Log("Main application opened")

...

Log_Message_Secondary_Log("Create button clicked")

 

At the end this could be exported in the same way as normal logs in the event of an error for instance as manual steps to reproduce.

  • Hi,

     

    Only one built-in log is possible in TestComplete.

    You may consider these options:

    a) Write to your own custom log. This can be implemented, for example, within OnLogMessage, OnLogError and so on handlers;

    b) Create a folder within test log (Log.CreateFolder) and write to it (copies) of the messages that you need. The problem here is that it is not possible to export/save just this folder but not the whole log, so you will have to find out a workaround that will work for you (learn relevant people to pay attention to just this folder; truncate everything but this folder from the saved log; something else).

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Only one built-in log is possible in TestComplete.

    You may consider these options:

    a) Write to your own custom log. This can be implemented, for example, within OnLogMessage, OnLogError and so on handlers;

    b) Create a folder within test log (Log.CreateFolder) and write to it (copies) of the messages that you need. The problem here is that it is not possible to export/save just this folder but not the whole log, so you will have to find out a workaround that will work for you (learn relevant people to pay attention to just this folder; truncate everything but this folder from the saved log; something else).

     

    • jr348's avatar
      jr348
      Contributor

      Thanks Alex.

       

      That's what I was suspecting.

       

      Think I'll go with the text file option to compile the simplified logged elements as the test runs.

       

      Then use the on-error event to post the contents of the simplified log to the main log with a screenshot.