Sign in to follow this  
Followers 0
iverson_est

Installing A Com Error Handler

3 posts in this topic

i'm having trouble installing a COM error handler.

#include <IE.au3>  
$Account = IniRead("Settings.ini", "Settings", "Kasutaja", "NotFound")  
$Password = IniRead("Settings.ini", "Settings", "Parool", "NotFound") 
HotKeySet("{ESC}", "Terminate") 
$o_IE = _IECreate ()
_IENavigate($o_IE, "http://www.rate.ee/show.php") 
Sleep(3000)  
Send($Account)
Send("{TAB}")
Send($Password)  
Send("{TAB}") 
Send("{Enter}")  
Sleep(4000) 
While 1 
    
$oForm = _IEFormGetObjByIndex($o_IE, 0)
$oViis = _IEFormElementGetObjByName($oForm, "rating", 5) 
$oViis.click  

Sleep(1000)
$oForm1 = _IEFormGetObjByIndex($o_IE, 0)
$oNeli = _IEFormElementGetObjByName($oForm1, "rating", 4)  
$oNeli.click  

Sleep(1000)  
$oForm2 = _IEFormGetObjByIndex($o_IE, 0)
$oKolm = _IEFormElementGetObjByName($oForm2, "rating", 3)  
$oKolm.click  

Sleep(1000) 
WEnd 
Func Terminate () 
    Exit 0 
EndFunc

it gets an error in about every 10 mintues or so.

should i just add this into my script sumwhere

$file_loc = @ScriptDir & "\rate login 1.au3"
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") 
Func MyErrFunc()  
ProcessClose("iexplore.exe")   
Sleep(2000)
Run(@AutoItExe & ' "' & $file_loc & '"', "",@SW_MAXIMIZE) 
Sleep(3000) 
EndFunc 
Exit

help please :think:

Share this post


Link to post
Share on other sites



Depends on the errors you are getting and what is causing them.

I would suggest adding an _IELoadWait($oIE) after your .clicks so taht the form has a chance to fully load before taking other actions... most likely cause for errors they way you have it now is trying to act on objects that don't yet exist.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

lol, excellent idea, thanks :think:

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  
Followers 0