Ask a Question

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

SOLVED
egiacomi
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

13 REPLIES 13
tristaanogre
Esteemed Contributor

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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available

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

 

tristaanogre
Esteemed Contributor

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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available

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

 

tristaanogre
Esteemed Contributor

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


Robert Martin
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available

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

 

This is my organize test

Cattura.JPG

tristaanogre
Esteemed Contributor

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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available

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

 

LOG.JPG

tristaanogre
Esteemed Contributor

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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: