Forum Discussion

jthompson1's avatar
jthompson1
Contributor
4 years ago
Solved

Does anyone have good examples of the user of Wait in keyword testing

I keep trying to implement the Wait property instead of using delay as our websites response times are all over the place and my tests keep failing because an object was not available yet. I was atte...
  • AlexKaras's avatar
    4 years ago

    Hi,

     

    Generally speaking, with most of modern web applications, one must wait three times:

    -- First, test code must wait until the requested page is obtained from the server. This is what .Wait() method in TestComplete is for;

    -- Then, test code must wait until the received web page markup is processed by the browser, until browser downloads all required additional libraries specified in page script code, until browser executes initial script code and renders the page. In a nutshell - on this second wait test code must wait until the target control appears on the screen. (Note, code must first wait for control itself and only then can wait for some property value of this control -- there is no reason to wait for the property of control that does not exist) This is what .WaitXXX() methods in TestComplete are for;

    -- Then, in some cases, test code must additionally wait until the target control is populated with data and becomes ready to interact with end-user.

     

    Two last waits does not have any special support in TestComplete and must be implemented in test code as the actual implementation of these waits depends on the tested web page.