Jump to content
Macro Express Forums

Condition Checking


Recommended Posts



I would like to launch a website with IE and then use the wait for web page command.


I then perform some commands like submitting a form (via <tab> and <enter> on submit button) and then use the wait for web page.


I want to use conditions to say that if the web page doesn't load in the time necessary or its loads an error page that i can trap that and send myself an email.


Currently my macro just aborts.


Do the commands have return values for successful or not?

Link to comment
Share on other sites

When an error page loads in IE, the window title changes to "Cannot Find Server" or something similar to that. I don't remember the exact title off the top of my head. You can use the "If Window Running" or the "If Window not Running" commands. Another option would be to use the "Variable Set String - Set Value to Topmost Window Title" command and then run logic tests on that variable. (i.e. If %T1% contains "cannot find", then send Email and Macro Stop, Else [continue with desired steps].)

Link to comment
Share on other sites

the problem is that sometimes you don't have any error page loaded in IE ... your page is simply loading ... loading ... loading ... and when the "Wait For Web Page" maximum time is reached, it raises an error (and stops your macro) !


maybe one day we'll have an option such as "stop loading when max time reached", or at least "continue" so that you can check by yourself if it finished because the page is loaded or because the max time is exceeded :rolleyes:


for now, it seems that the better way to handle this kind of situation is to create your own "wait for web page"-like macro ! this point has already been discussed here : http://pgmacros.com/community/index.php?showtopic=139

... where you should find some ideas ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...