Forum Discussion

Egg's avatar
Frequent Contributor
3 years ago

I wanna start functions after web page completely comes out.

Hellow, I wanna start keywordtest functions after web page completely comes out.

When I running my keyword test, sometimes run broked up. not because truely couldn't find object but because just page's lated load. 

In this situation, What can I available functions? usually I use 'Delay' Operation.  But it's not a perfect way in that situation. 

Because, Sometimes page late than Delay that I set.  

I wanna more accurate keyword test. Please recommend functions.


Thank you. Have a nice day ^^

3 Replies

  • Hi,

    A few options here:

    Use the Wait method to pause the test run until a web browser loads the specified web page completely. 
    In Keyword tests you can use the object spy to select the page object, and there should be the wait operation available.

    Or a simple script works too: 

    We could wait for more dynamic events. Use the WaitProperty method to pause the test execution until the specified object property achieves the specified value or until the specified timeout elapses.
    So here we can wait for a progress bar to say "completed" or something similar. 

    An option that would cause TestComplete to wait longer for an object to become visible, is the auto-wait timeout. In Tools> Current project properties> Playback> Auto-wait timeout

    The Auto-wait timeout default timeout is 10000 ms. When a test gets a reference to a process or window object, or when it activates an object (for example, opening a minimized window), the object may not be available immediately. Similarly, when a test changes the onscreen state of a window (for example, an open window is minimized), or when attempts to close an unexpected window, the change may not occur instantaneously. Auto-wait timeout is the number of milliseconds TestComplete waits for an object to become available or for the object state to change before posting a timeout error message to the test log. If the object becomes available or the desired change occurs within the delay allowed, the test proceeds immediately. If the timeout elapses, the error message is posted to the test log. What happens next depends on the On error and On object recognition error properties.

    • sonya_m's avatar
      SmartBear Alumni (Retired)

      Thanks, everyone!


      Egg could you mark the best reply as a solution here if it helped you?