Jump to content

if else @error when object interaction failed?


Recommended Posts

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?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...