Forum Discussion

marin's avatar
marin
Frequent Contributor
13 years ago

How to flush test log?

Hello all,



I wonder if it somehow possible to flush test log?

My test environment consists of a project suite with 2 projects, each project dedicated to a different application brand.

Project suite is defined to have 2 test items (projects mentioned above). At end of each project there is a method that sends test log to a specific recipient - different recipient per project.



What I'd like to achieve is to send the "part log" per project to dedicated recipient. I.e. when prjoect 1 is finished send log regarding project 1 to recipient A, then flush log, then when project 2 is finished send log regarding project 2 to recipient B.



Currently,  there will be correct log sent to recipient A (log for project 1), but then after project 2 is finished, recipient B will receive  the entire (cumulative) log: both for project 1 and for project 2.



I thought of somehow flushing the log after project 1 finishes - is this possible?

Are there any other possibilities to achive what I am aiming at?



Many thanks for any hints,



Marin

4 Replies


  • Hi Marin,


     


    As far as I understand, you export logs from script as exporting specific project items and test items' logs is possible from TestComplete's GUI, right? At this moment, there is no built-in feature. However, we have a suggestion in our DB to implement it and your request has increased its rating. Thanks.


     


    You can create your own script that will parse the whole test log and separate it into needed parts. Refer to the "Scripting Access to the Test Log Contents" article for more information.


     

  • marin's avatar
    marin
    Frequent Contributor
    Hello Tanya,



    thx for the reply.

    Your assumption is correct - I am exporting the log from script and not from GUI.

    I have a dedicated method which extracts test items' log headers (without log data) and sends these via eMail to dedicated recipients as a quick overview with a hyperlink to the physical log file (which is exported to a central storage on internal network).

    Thus it is made sure that eMail will not contain (sometimes quite large) log file but only an info with a hyperlink to the real log file.

    I thought of script access as well, just wanted to verify if there was "an invented wheel" existing somewhere in TestComplete already.



    Thanks for the info about existing request, good to know that it has been requested by other users as well.



    Marin
  • maximojo's avatar
    maximojo
    Frequent Contributor
    An obvious idea but you could keep both projects in the project suite but run them separately from the command line with the /p:projectname command line option.



    After each finishes you mail off the log information as you need.



    Cheers

    Mark
  • bbi's avatar
    bbi
    Contributor
    Hello,





    I'm adding to this request.



    Indeed, in our TestComplete scripts, we're running several project suite, each of them having one to thirty project inside. And due to this cumulative way of logging, the big pjs have at the end some very huge logs (they are commited into TestLink). And we call Log.SaveResultAs at project level.



    We cannot run individually projects from command line because of setup/tear down which are sometimes dependent between projects.



    I understand that we need to parse ourself the logs object but could we overload the Log.SaveResultAs to implement this parse ?





    Rgds,

    Benoit