Forum Discussion

sunsmile's avatar
sunsmile
Occasional Contributor
15 years ago

Wait On IE To Load Completely


Hi,

I am using below code to open a new IE browser window. Is there anyway i can remove  the code aqUtils["Delay"]("18000"); and wait till IE loads and opens completely.



TestedApps["iexplore"]["Run"](1, true);



  aqUtils["Delay"]("18000");



Like is there any method like TestedApps["iexplore"]["WaitOnIE"] in TestComplete to wait till IE loads completely?



Thanks In Advance.



5 Replies

  • You can do this in many ways,



    Call Sys.WaitProcess("iexplore", 30000)   '30 seconds as the time out

    Call Sys.WaitChild("iexplore", 30000)   '30 seconds as the time out




    and many more approaches....




    Thankyou

  • Hi,



    The Run method waits until the launched application is ready and returns its process. You need to obtain IE like this:

    ...

    var ie = TestedApps["iexplore"]["Run"](1, true);

    // Work with IE

    ...

  • Cameronsmith63's avatar
    Cameronsmith63
    Occasional Contributor
    Is there a way where we don't need to hard code the amount of time needed for the webpage to open? I want TC to detect when the page is loaded and not time down from 20 seconds, something similar to the browser.wait function, only the browser.wait function doesn't wait as long as it should, playback stops prematurely.