cancel
Showing results for 
Search instead for 
Did you mean: 

How can I check an event like the start run execution(first test started) and the end ?

SOLVED
Contributor

How can I check an event like the start run execution(first test started) and the end ?

Hi,

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?

 

Emanuele

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: How can I check an event like the start run execution(first test started) and the end ?

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.


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
13 REPLIES 13
Community Hero

Re: How can I check an event like the start run execution(first test started) and the end ?

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.


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
Contributor

Re: How can I check an event like the start run execution(first test started) and the end ?

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

 

Community Hero

Re: How can I check an event like the start run execution(first test started) and the end ?

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.


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
Contributor

Re: How can I check an event like the start run execution(first test started) and the end ?

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?

 

Thanks

Emanuele

 

Community Hero

Re: How can I check an event like the start run execution(first test started) and the end ?

I don't understand what you mean by "considers the utility scripts".  


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
Contributor

Re: How can I check an event like the start run execution(first test started) and the end ?

The first four tests are the utility script, I want to disabled the logs for these tests.

 

This is my organize test

Cattura.JPG

Community Hero

Re: How can I check an event like the start run execution(first test started) and the end ?

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.


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
Contributor

Re: How can I check an event like the start run execution(first test started) and the end ?

I follow your instructions , however utility scripts are logged...

 

LOG.JPG

Community Hero

Re: How can I check an event like the start run execution(first test started) and the end ?

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.

Possible workaround/solution:

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.


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
New Here?
Join us and watch the welcome video:
Join the September Hub-bub to show off, learn and win