Markter Posted February 7, 2005 Report Share Posted February 7, 2005 Good day everyone, I would like to use the Wait for Web Page to Load command, but do not want the my macro to be aborted if the Web page does not load in time. I would like the macro to continue running. Is this possible? Thanks! Mark Quote Link to comment Share on other sites More sharing options...
joe Posted February 7, 2005 Report Share Posted February 7, 2005 This should work. Repeat Until %N1% <> %N1% Web Site: http://www.pgmacros.com [Default Browser] Wait for Web Page: "" Repeat Start (Repeat 60 times) Variable Set String %T1% from Window Title If Variable %T1% contains "Macro Libraries" Repeat Exit End If Delay 250 Milliseconds Repeat End If Variable %N1% = 60 AND If Message: "Web Page Error" Else Repeat Exit End If Repeat End <REP3:08:000002:000002:0001:1:01:N1><HTTP2:1:F:http://www.pgmacros.com><WAITWEB2:000000:000000:><REP3:01:000001:000001:00060:1:01:><TVAR2:01:06:><IFVAR2:1:01:7:TMacro Libraries><EXITREP><ENDIF><IMSD:250><ENDREP><IFVAR2:2:01:1:60><AND><IFMESS3:00000:1:1:Web Page Error Could not load the web page. would you like to try again?Center:Center><ELSE><EXITREP><ENDIF><ENDREP> It is designed to avoid waiting for a particular page to load. Instead the Wait for Web Page command waits indefinitely for any page to load. If the browser launches at all then some web page should load, even if it is one of those "This page cannot be found" error pages. The Repeat Start (Repeat 60 times) loop is used to test for a particular window title to have focus, which is the title of your target web page. Since it delays 1/4 of a second between loops, it will wait 15 seconds and then exit. If the loop counter is 60 then you are prompted to try again. This is only meant as an example. There are plenty of variations that can be made to this macro to suit your individual needs. Quote Link to comment Share on other sites More sharing options...
Markter Posted February 7, 2005 Author Report Share Posted February 7, 2005 Thank you Joe, I will give it a try. Quote Link to comment Share on other sites More sharing options...
m204prgmr Posted February 8, 2005 Report Share Posted February 8, 2005 Thanks Joe, I had a situation on Saturday where my Macro aborted because a web page did not load, the system lost connectivity. It made me go back and look at the code and determine I did not need a Internet page to load but rather a Intranet page. I was loading an Internet to load the Intranet....DOH! Robert Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.