Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: load web page
So it can look for the DONE message when the browser is finished loading. Works great.
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.
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.
However, if you are using HTTPS, that portion of the screen is locked, and we can't get to it.
Notice that the little globe stops turning when the page is finished loading, at which time a windows message is sent out and the window parameters are set to 0... unfortunately Winbatch has no way of intercepting a windows message, so we can't do anything with this information. If you can switch over to Netscape, you might have more luck detecting when the page is loaded, when using HTTPS.
Here is a subroutine that seems to do the trick - this particular one works with IE4 and the "Done" at the bottom of the window. For NN4.5 change "Done" to "Document: Done". You WinBatch pros out there can probably clean up or make suggestions on improving my code, but this seems to work.
Make certain you set the hwnd varaible once at the top of the program using some lines similar to:
runzoom("C:\Program Files\Plus!\Microsoft Internet\IEXPLORE.EXE", "") timedelay(2) ie1=winidget("~Microsoft Internet Explorer") hwnd=dllhwnd(ie1) hwnd=cwndbyclass(hwnd, "msctls_statusbar32") timedelay(10)
One technique may be to place a line of Javascript at the end of the the HTML which in turn opens a dummy window with a title that you can wait for. I'm not sure if the images will have been loaded, or if you can use the onLoad event to perform a similar function (this technique is sucky, but bottom line - Winbatch can detect a new Window). In this example, we are inserting a JavaScipt applet to pop up a window saying "loaded" and Winbatch can see that.
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.
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.
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