cancel
Showing results for 
Search instead for 
Did you mean: 

Extract relevant information from TestComplete logs

Frequent Contributor

Extract relevant information from TestComplete logs

Hi,

I have a grop of 100 tests which have so many Log.Checkpoint and Log.Error statements. 

In the logs, I have to go to individual test logs under the root to get the count and details for Log.Checkpoint and Log.Error messages.

 

Is there a way to pull out all the Log.Checkpoint, Log.Error and Log.Warning messages from the log file and publish them in another log file? Also, is it possible to get the counts of pass, fails and warnings too? 

 

any help would really be appreciated! 

image.png

 

 

Thank you

Abhi

 

4 REPLIES 4
Community Hero

Re: Extract relevant information from TestComplete logs

Frequent Contributor

Re: Extract relevant information from TestComplete logs

Thanks marsha! I had tried some of these already, but it doesn't do what I need.

 

Thank you

Abhi

Community Hero

Re: Extract relevant information from TestComplete logs

There is no "other log file" built in to TestComplete.  In order to write out to another file, you'll need to create code to do so using things like aqFileSystem and so forth.  To get them to NOT add into the TestComplete log, you'll need to implement OnLogCheckpoint, OnLogWarning, and OnLogError event handlers to suppress the log entries... in fact, it would be those handlers, as well, that would do the work of writing out to the external file so that, once you suppress them, they would be written in the desired location.

 

As for counts... built in to TestComplete is the following summary on the log.  Note that the counts on this summary only pertain to Test items and how many passed or failed and how many had warnings.  These counts do not pertain to the log entries you noted but only the actual "Test Items" within the individual projects.

projectlogsummary.png

 

There is an erorr/warning count available as well.  This doesn't break it down by project or test item, just gives totals.

 

testexecutioncounts.png

 

so... to do EXACTLY what you want will take code writing, utilizing the link that Marsha gave you and other similar documentation along with the event handlers I mentioned.  So, it's possible to do it, just it will have to be written.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Community Hero

Re: Extract relevant information from TestComplete logs

You could use Test Completes event handlers for all of the different log types to write them to you own file.

 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/handling-events/creating-handl...

 

The Log object already has counts for all the diffent log types: 

 

https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/properties.ht...


Thanks,
Carson

Click the Accept as Solution button if my answer has helped