cancel
Showing results for 
Search instead for 
Did you mean: 

Long time goes by between Runner.Stop(true) and the start of next testitem

Contributor

Long time goes by between Runner.Stop(true) and the start of next testitem

Hi all,

 

For my project I use the scripting- approach (JScript). My testcases are capsulated in testitems. The complete Project has around 400 testitems. Some of the testitems have not be be executed (for example based on countries).

I use the "OnStartTest" and "OnStopTest" events. Before a testitem starts it loads it's configuration (for example country settings, users and so on). Based on these informations the script starts a simple check if the testcase is allowed to be executed. If the testcase has not to be executed I use "Runner.Stop(true)". In the "OnStopTest"  event some loggings are executed. So far so good. 

Now I see that the time between the stop of a testcase (stop- event was processed) and the start of the testcase (start- event) increaeases after each execution. That means that there are for example 10 testitems that must not be executed. After the first testitem it takes only around one second between the stop and the next start. After the second stop it takes more than 2 minutes. Than five .... after the 5th stop it takes around 30 minutes. I can also see, that the memory usage decreases after the stop- event. It seems that testcomplete starts to destroy some objects.

 

So my question is if somebody else has the same problem or has a solution.

 

P.S: If testitems are allowed to be executed it takes only one second between stop and start

 

I use TC and TE 12.10 and 12.60, always the same behaviour

5 REPLIES 5
Community Hero

Re: Long time goes by between Runner.Stop(true) and the start of next testitem

It might be helpful to see what you have in your OnStopTest handler.  What it sounds like is that you're doing some sort of code processing that, the more test items have been executed, the more processing is being done.


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: Long time goes by between Runner.Stop(true) and the start of next testitem

In the OnStopTest- handler I log a state in a a flat file. But also if I comment out each function or code it has no  effect. 

Contributor

Re: Long time goes by between Runner.Stop(true) and the start of next testitem

I have tried a workaround. Each testcase is capsulated by a try- catch block. Instead of using the "Runner.Stop(true)" code I throw an error with a defined message and code. Then the catch block is entered. Within the LogError- Event I check for the exception- text that I have defined. If it matches I set my testcase to true (a function that I have to be able to log in to a flat file) and no error is through. Now I have no delay between the execution between stop and start.  

Highlighted
Contributor

Re: Long time goes by between Runner.Stop(true) and the start of next testitem

Does anyone have an idea how to solve that?

Community Hero

Re: Long time goes by between Runner.Stop(true) and the start of next testitem

I requested in an earlier message for you to share the actual code of your event handlers.  Are you able to do this?


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:
Watch the new interview