Forum Discussion

pramod_tr_rao's avatar
pramod_tr_rao
Occasional Contributor
11 years ago
Solved

Test Complete does not wait until the entire Page/Frame is loaded even though we wait for the ready state to be complete

Hi,    We have an issue where Test Complete performs operation on an object even before the entire Page/Frame is loaded. We have put in a function that checks and waits until the readystate of the ...
  • AlexKaras's avatar
    11 years ago
    Hi Pramod,



    Does your tested web page contain script(s) code that modify the content of the page?

    The case is that browsers set the page ready flag (that TestComplete looks for) when the page is obtained from the server. Then, the browser executes scripts on the page. But this happens with the ready flag already set. Depending on the scripts, browser and local system load, scripts execution can take significant time.

    According to my experience, the best way is to wait until the page is loaded (page.Wait). Then, it is really good if you can find some object that, if found on the page, indicates that the browser completed scripts processing and the page is ready to interact with the end-user. Wait for this object to exists.

    Then you may proceed with the test using your current approach: not to try to perform some action against some object on the page, but first check if this object exists and wait (using timeout) until the object appears if it was not found. And only after the object was found, proceed with the actions against it.



    The described approach works pretty well for me for several highly scripted web applications.



    Hope this will help.