views:

17

answers:

1

HI all,

I am trying to script some actions on a web based application by using simple SendKeys in a .VBS script.

The only problem i have come accross is the fact that i have to put Sleeps in the script to wait for pages loading.

I was wondering if there was a was i could monitor an IT window and wait for it to finish loading instead of using a Sleep command.

This would reduce un-needed pauses (if the system is running fast for once)

Thanks,

A: 

IE has a 'Busy' property.

When the page is loading: Busy = true When the page is ready: Busy = false

If you use a Do While loop until Busy = false your script will wait until the page is loaded

Bear Box
Thanks for the response. But i believe that that property is only accessible when my script called the IE window. The windows i want to check were not called by my script.
Ok if your script is not opening the IE window, you can get the windows 'HWND' value you should be able to referance it using that, then check the 'ReadyState = 4'
Bear Box