Forum Discussion

sdruker's avatar
sdruker
Contributor
10 years ago
Solved

How to use the Testcomplete log object

Hi,

I want to write a script to generate a customizied report from my test results or maybe to store the data from the log into database table.



For example , I want to know the test names , how much steps each test has, how many steps pass and how much fail , the error messages etc...

 

I read the article : 


Scripting Access to the Test Log Contents


http://support.smartbear.com/viewarticle/55140/



b
ut I'm still kind of lost...

there are a lot of logs, and it's not clear how to parse them

Does anyone already wrote something like that and can help by adding an examle? 



Thanks!!

Sivan
  • Have you read one of the articles linked on the Scripting Access page. The article I am refering to is "Exporting Test Results" http://support.smartbear.com/viewarticle/55128/ - this Artilce talks about two different methods of exporting the logs.



    One is as unpacked storage and the other is multipart hypertext storage. The multipart storage option is viewable in most web browsers either natively or by using an add-on. I suggest reading this article.



    Beyond that, you say you want to export basically the stats and possible problems to a database?

    I think this can be done with error handling and scripts. - OnError - do this - maybe some try catch statements but that would be while the scripts/tests are running.

    If you want to do it after a test or series of tests were run, then a situation of where you have a separate test or script read the log, parse the log to it's components, connect to your db server - write records, etc.



    I think depending on the depth and scope that you want for your log database to have it will grow depending on how often your tests are run.

6 Replies

  • Have you read one of the articles linked on the Scripting Access page. The article I am refering to is "Exporting Test Results" http://support.smartbear.com/viewarticle/55128/ - this Artilce talks about two different methods of exporting the logs.



    One is as unpacked storage and the other is multipart hypertext storage. The multipart storage option is viewable in most web browsers either natively or by using an add-on. I suggest reading this article.



    Beyond that, you say you want to export basically the stats and possible problems to a database?

    I think this can be done with error handling and scripts. - OnError - do this - maybe some try catch statements but that would be while the scripts/tests are running.

    If you want to do it after a test or series of tests were run, then a situation of where you have a separate test or script read the log, parse the log to it's components, connect to your db server - write records, etc.



    I think depending on the depth and scope that you want for your log database to have it will grow depending on how often your tests are run.
  • hlalumiere's avatar
    hlalumiere
    Regular Contributor
    I did exactly that, but through a dashboard application in our case.  This is what it looks like:







    The data in there is derived from our testlogs which are entered in a SQL database by our automated test controlled (also written in-house). In your case you could fill the table by writing to the databse directly from your scripts, as said above through events. This is what our TestLog table looks like:



  • Hi,



    It look great!



    What is that dashboard application, is it internal application that was developed in you company or an external help application?





    Thanks

    Sivan

  • hlalumiere's avatar
    hlalumiere
    Regular Contributor
    It's an application I wrote internally to manage our bank of 45 test machines. Essentially I just export the log to HTML after the test, and insert the tests results in the database along with the path to the exported logs. The application updates itself as the data adds up to the database.
  • In what language did you write it?

    Is it possible to get it ?

    I know how export the log into html but the steps afterwards are not clear to me.

    maybe you can upload an example of the function you are implementing after it?



    Thanks,

    Sivan
  • hlalumiere's avatar
    hlalumiere
    Regular Contributor
    It's in VB.NET, and no I cannot share it because it's highly specific to our setup. Keep in mind you could do the whole thing in any language you like, it could even be just a web app. The important part is to gather the data in a database. The rest is just visualization.