Forum Discussion

maxtester's avatar
maxtester
Contributor
6 years ago

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

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    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.

    • maxtester's avatar
      maxtester
      Contributor

      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. 

      • maxtester's avatar
        maxtester
        Contributor

        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.