Jump to content
Sign in to follow this  
smellyfingers

if else @error when object interaction failed?

Recommended Posts

smellyfingers

Hey, is it possible to avoid program crash when interaction with IE object fails?

Like if the object isn't found it waits until it is, i've tried _IEWaitload and _IEWaitLoadTimout before interacting but doesn't seem to work so i think i need some function that holds or loops and then try again, probably simple but i can't get it working.

The program can run for different amount of times before crash when suddenly interaction fails, just need a few pointers in the right direction, is it possible to use the @error or just a wait for loop?

If you take google search for example:

#include <IE.au3>
Local $oIE = _IEAttach("Mystart")
WinActivate("Mystart")
$oIE.document.forms.homepage_app_searchform.q.value = "1234567890"
Sleep(300)
_IELoadWait ($oIE)
WinActivate("Mystart")
$oIE.document.forms.homepage_app_searchform.childNodes.item(1).click
Sleep(300)

Now my program crash in a similar way if the "$oIE.document.forms.homepage_app_searchform.q.value" interaction fails, but how can i tell the program to try again when this error occurs or is it a fatal error?

Share this post


Link to post
Share on other sites
smellyfingers

Thanx John, tried a loop with over 300 test runs, completed without crashes! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×