in my organize test i have some utility scripts , i want to exclude these script from the final log and to do this i thought i'd run them after checking the start run execution event .
I have the same problem for the end run execution, how can i check these events?
Solved! Go to Solution.
Anything that is a Test Item in a project will show up as a node. Your best best is to incorporate your utility code somehow into your tests or, if they are build up andtear down kinds of things, perhaps make a completely different project and add it to the project suite to execute before your main project and another project for tear down to execute after the main project. Then your log for your main project will be pristine.
I'm not sure what you mean by "exclude them from final log"?
As for starting test and ending test, in the help, look into the OnStartTest and OnStopTest event handlers.
Sorry maybe I explained myself wrong, i want to check the start execution of the first test and the end execution of the last test . For example if I use the event OnStartTest I can't know if it's the start of the first or second or third test
How are you organizing your tests in TestComplete? Are you using TestItems to do so?
If that's the case, you could simply set your utility scripts as the first test items that execute and the last ones that execute. Then, in those tests, do a Log.Enabled = false until the utilities are done and then Log.Enabled = true when they are finished. That will turn on/off the test log for those scripts.
I tried to follow your suggestion but unfortunately it doesn't solve my problem, though the flag Log.enabled is false however TestComplete considers the utility scripts
Do you have others ideas to solve this problem?
I don't understand what you mean by "considers the utility scripts".
The first four tests are the utility script, I want to disabled the logs for these tests.
This is my organize test
OK... then... at the beginning of Script\TakeBuild-TakeBuild call "Log.Enabled = false".
At the end of Script\ClearLocalTestData-CleanLocalTestData call "Log.Enabled = true".
At the beginning of CLoseBSuite call "Log.Enabled = false"
At the end of ExportLog call "Log.Enabled = true".
This will enable and disable the logs for those scripts.
OK. I did a bit of experimentation. It appears that the Log gets re-enabled for each Test Item in the project. So, each script you don't want to log messages, you need to make sure that it has the Log.Enabled commands in it.
Item of note... you'll still see the node in the test log for the item that has the log disabled. It will be empty (no messages) but the node will still exist.
Move your utility code calls into a single script that calls all of them in sequence. Then call the Log.Enabled at the beginning of that single script. This will reduce the number of nodes.
Followup question: What's the reasoning for suppressing the logging for those utility scripts? It seems that there is valid information in at least one of them giving indication of the version for the automation.