WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

URLs - Web - Browser Topics

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Waiting for a Web page to load

Keywords:    load web page

Question:

I am launching an application that brings up a modal form. I wish to send keystrokes to this form but WinBatch won't wait for the form to load before issuing the SendKeysTo command. I've tried all of the examples the help recommended to no avail. Is there any way I can do this without using a pre-set time delay?

Answer:

In the Control Manager extender there is a cGetSBText function that can read the status bar at the foot of Netscape and MSIE browsers.

So it can look for the DONE message when the browser is finished loading. Works great.


Question:

Is there a way to force Winbatch to wait for the entire web page to load before proceeding? I tried WinWaitExist but the Window name loads before all the graphics do.

I am trying to time Netscape as part of Performance monitoring of an application that is migrating to a web based platform. I have looked at the WinBatch Internet extender, however that does not give me the same result as Netscape. I have also tried to key on the IsMenuEnabled function, however it only works if the application supports it. Any other ideas would be helpful.

Answer:

Netscape seems particularly hard to work with.

Sometimes its better to step back and look at what you are trying to accomplish. If you are trying to move information to files there are a couple of different ways to do it.

I'll start off recommending our Internet Extender which allows you to download web pages or images directly to files. No web browser needed.


Another Question on Determining if Page has Loaded:

Is there some way to winbatch know if the webpage loaded (done)? I have to see if the page is open and only after it is opened I have to send some keys to it to process the information and show to the user the answer of the page.

Ex.: I have to open an webpage with any browser (Netscape or IExplorer). As soon as it opens I have to send to the page some infomation on certain fields. My question is: Is it possible to see if the browser have finished to read the page?

I tried use the window name, but when it starts to open, window name appears, but I don't know the necessary DELAY TO SEND THIS TEXT TO THE PAGE.

Answer:

It is quite tricky to watch a Browser and see when it is done. Several different strategies have been used, but none of them are particularly easy. If all you want to do is fill out a form and capture information - you may not need the Browser - the new WININET extender *might* be able to do it for you.

Is the process supposed to be 100% automated, or does a real user have to examine the screen and make decisions?

If it's a real user, then they could press a key to continue.

If it is 100% automated, then with Winbatch and the (old) WinSock or the (new) WinInet extenders you can completely automate the operation without a Browser. Winbatch with the extenders can read and respond to web pages. If the HTML page that you're opening is one that you can edit yourself, then having WinBatch check to see if the page is loaded is a cinch. If the page isn't something that you can edit, though, well damn, good luck.

The best way to detect page loaded is to check whether the View|Stop option (I forgot what it is called in NN) is active or not. However, the newer IE4 interface (it is actually the new menu used in all newer office applications) is still beyond the Control Manager extender. We still have not cracked the MSIE buttonbar/menu.

Response from User:

The user has to see the page and after loaded, the winbatch script has to send some information and I can't edit the page.

On Netscape I found a solution (I think) that I'm going to test. I open the browser with the page that I want and I check if the menu VIEW/PAGE SOURCE is enabled or not. If it's enabled, it has finished loading.

Now, on IExplorer I don't have any clue since the menu items are always enabled.


Article ID:   W13359
Filename:   Wait for a Web Page to Load.txt
File Created: 1999:04:15:16:53:30
Last Updated: 1999:04:15:16:53:30