Forum Discussion

srilatha_1's avatar
srilatha_1
Occasional Contributor
13 years ago

Is there any way to increase the wait time?

In project which is client server  based system, script executes fine if the servers response time is normal speed, but if for some reason the response time is slow, my script fails.

I can add a maximum delay or wait time, but this is not desirable. I want to know if there is any other way to calculate the response time from the server and see if that is more than desirable, and add the wait time in the scroipt.



Can anybody help me?



Thanks,

Srilatha

1 Reply

  • sbkeenan's avatar
    sbkeenan
    Frequent Contributor
    Hi Srilatha 






    If you have mapped the various windows and controls of your application you can use the WaitAliasChild method.  This allows you to specify a maximum amount of time to wait for an object to be available, but if its available sooner, TestComplete will act on it.  So, for example, if you were to use something like:



        Call MyApp.WaitAliasChild("WindowName", 60000).btnOK.ClickButton



    TestComplete will wait for up to 1 minute for th ewindow to appear before acting on it's OK button.  If however, the window was to appear after only a few seconds, TestComplete will see taht and act on it immediately, without waiting for the full minute.



    There are other Wait... methods that you can use if WaitAliasChild isn't appropriate.  Details of all of them can be found in the help files.



    Hope this has at least pointed you in the right direction.



    Regards

    Stephen.