FabFly Posted January 3, 2006 Share Posted January 3, 2006 Hi all, I wrote a stand alone application with autoIT using IE with IE.au3 but I often have the error message that I provide in the attachement. I don't understand why I've got it but not every time. I give you my script in attachement. Is it my script or IE? Thanks for your support. FabFlyrobot_bo5_us.au3File_Ressources_BO5US.au3IE.au3 Link to comment Share on other sites More sharing options...
seandisanti Posted January 3, 2006 Share Posted January 3, 2006 Hi all,I wrote a stand alone application with autoIT using IE with IE.au3 but I often have the error message that I provide in the attachement.I don't understand why I've got it but not every time.I give you my script in attachement.Is it my script or IE?Thanks for your support.FabFlyit looks like the error is being generated in the UK version of the file, not the US version that you've included. are the two files the same? I just don't want to look through the included script if the issue is only occuring in the other. Link to comment Share on other sites More sharing options...
FabFly Posted January 4, 2006 Author Share Posted January 4, 2006 Hi, Indeed, the error appears in the two scripts. But not every time, it looks very strange.. Thanks FabFly Link to comment Share on other sites More sharing options...
seandisanti Posted January 4, 2006 Share Posted January 4, 2006 Hi,Indeed, the error appears in the two scripts.But not every time, it looks very strange..ThanksFabFlytry declaring $IE_BO5US as global... that's the first thing that comes to mind since you're directly using it several functions... Link to comment Share on other sites More sharing options...
FabFly Posted January 4, 2006 Author Share Posted January 4, 2006 Hi, I've done it. I'll give you the result tomorrow. Thanks. FabFly Link to comment Share on other sites More sharing options...
seandisanti Posted January 4, 2006 Share Posted January 4, 2006 Hi,I've done it.I'll give you the result tomorrow.Thanks.FabFlycool, i hope it helps, it was just the first thing i noticed, i didn't have time to step through all of the code, nor did i try runing the script Link to comment Share on other sites More sharing options...
FabFly Posted January 5, 2006 Author Share Posted January 5, 2006 Hi, I've got the same error with a GLOBAL definition. So there is the same problem. Thanks. FabFly Link to comment Share on other sites More sharing options...
FabFly Posted January 5, 2006 Author Share Posted January 5, 2006 Hi, I renamed all my variables in each script with a different name but nothing. The problem is still here. I really don't understand why sometimes the problem occurs and sometimes not. Does anyone have a clue, an idea or a solution. thanks for your support. Regards, FabFly Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 Hi,I renamed all my variables in each script with a different name but nothing.The problem is still here.I really don't understand why sometimes the problem occurs and sometimes not.Does anyone have a clue, an idea or a solution.thanks for your support.Regards,FabFlyi will look at it again and let you know if i find anything.... Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 i will look at it again and let you know if i find anything....try commenting out line 237 _IELoadWait ($Frame) i think that's the issue. $Frame isn't a browser object, so it doesn't have the same methods available to it... i believe that doing a _IELoadWait() with the variable to your browser object will have it wait until EVERYTHING in the browser has finished downloading, including the frame. Link to comment Share on other sites More sharing options...
FabFly Posted January 5, 2006 Author Share Posted January 5, 2006 Thanks a lot for your support. Regards, FabFly Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 Thanks a lot for your support.Regards,FabFlynp, i'm glad to help, and i hope it works. i'd also still leave the global declarations though Link to comment Share on other sites More sharing options...
FabFly Posted January 5, 2006 Author Share Posted January 5, 2006 ok thanks. I've done it. I launched my scripts for tyhis night, I'll see tomorrow if it's great or not. I provide you the update script. Regards, FabFly Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 ok thanks.I've done it.I launched my scripts for tyhis night, I'll see tomorrow if it's great or not.I provide you the update script.Regards,FabFlyyou're not able to test them real time? Link to comment Share on other sites More sharing options...
DaleHohm Posted January 5, 2006 Share Posted January 5, 2006 (edited) Edit: I posted the following after cameronsdad posted his reply (although I started typing hours ago :-) ) I think that the diagnosis above is probably correct, but I'll leave this reply here because it offers good troubleshooting advise.The cause of the error is that, at the time the function is called, the variable passed into _IELoadWait() is either 1) not an object, 2) not the right type of object or 3) for some reason does not have a valid .document property. I actually don't know if (3) is possible, but it may be that there is occasionally some sort of a timing issue that could create that situation -- we were investigating this possibility with another user but never got enough information back to know.You can do some further diagnostics prior to calling the _IE* functions to try to dig into this.It will probably help you to figure out which call to _IELoadWait() is actually returning the error. Note that several functions (like _IENavigate() for example) call _IELoadWait() on your behalf. Each of the functions that do this have an optional "wait" parameter to disable this. I would not recommend calling _IELoadWait() explicitly after those calls -- it would typically just be wasted cycles, but client or server-side redirects could create confusion and possibly situations like the one you are experiencing.You'll want to use three AutoIt functions here for your debugging: isObj() ObjName() and ObjEvent().Here's some error trapping code you can use to get more data. This assumes that your _IECreate() object is called $oIE -- modify as necessary.$oMyError = ObjEvent("AutoIt.Error","MyErrFunc"); Install a custom error handler from main program ; ** Your code here ** Exit ; This is my custom error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) ConsoleWrite( _ "We intercepted a COM Error!" & @CR & _ "Number is: " & $HexNumber & @CR & _ "Windescription is: " & $oMyError.windescription & @CR & _ "scriptline is: " & $oMyError.scriptline & @CR) If isObj($oIE) Then ConsoleWrite( _ "$oIE is object: " & isObj($oIE) & @CR & _ "$oIE object type: " & ObjName($oIE) & @CR & _ "$oIE.document is object: " & isObj($oIE.document) & @CR & _ "$oIE.document object type: " & ObjName($oIE.document) & @CR) Else ConsoleWrite( _ "$oIE is NOT an object!" & @CR) EndIf SetError(1); something to check for when this function returns EndfuncDale Edited January 5, 2006 by DaleHohm 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 Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 Edit: I posted the following after cameronsdad posted his reply (although I started typing hours ago :-) ) I think that the diagnosis avove is probaby correct, but I'll leave this reply here because it offers good troubleshooting advise.The cause of the error is that, at the time the function is called, the variable passed into _IELoadWait() is either 1) not an object, 2) not the right type of object or 3) for some reason does not have a valid .document property. I actually don't know if (3) is possible, but it may be that there is occasionally some sort of a timing issue that could create that situation -- we were investigating this possibility with another user but never got enough information back to know.You can do some further diagnostics prior to calling the _IE* functions to try to dig into this.It will probably help you to figure out which call to _IELoadWait() is actually returning the error. Note that several functions (like _IENavigate() for example) call _IELoadWait() on your behalf. Each of the functions that do this have an optional "wait" parameter to disable this. I would not recommend calling _IELoadWait() explicitly after those calls -- it would typically just be wasted cycles, but client or server-side redirects could create confusion and possibly situations like the one you are experiencing.You'll want to use three AutoIt functions here for your debugging: isObj() ObjName() and ObjEvent().Here's some error trapping code you can use to get more data. This assumes that your _IECreate() object is called $oIE -- modify as necessary.Daleawesome, thanks for the tips dale! i do have a few questions though, just to make sure that i'm understanding your code (ie.au3 not the debugging code). Func _IELoadWait($o_object, $i_delay = 0) If IsObj($o_object) Then ;doesn't this avoid the possibility of errors generated by non-objects $s_oname = ObjName($o_object) Sleep($i_delay) While ($o_object.document.readyState <> "complete") and ($o_object.document.readyState <> 4);do frames and iframes have readystate properties? Sleep(100) WEnd SetError(0) Return 1 Else SetError(1) Return 0 EndIfEndFunc Link to comment Share on other sites More sharing options...
DaleHohm Posted January 5, 2006 Share Posted January 5, 2006 awesome, thanks for the tips dale! i do have a few questions though, just to make sure that i'm understanding your code (ie.au3 not the debugging code).MSDN documents that Frame and iFrame as well as InternetExplorer have readyState properties. Also, the .document objects of each of them do as well.That said, I implemented on faith in the MSDN documentation so validation of the documented assumption overrules MSDN Let's see what we find out...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 Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 MSDN documents that Frame and iFrame as well as InternetExplorer have readyState properties. Also, the .document objects of each of them do as well.That said, I implemented on faith in the MSDN documentation so validation of the documented assumption overrules MSDN Let's see what we find out...Dalethanks again, i don't have access to msdn here at work so i couldn't have checked that stuff myself even if my perpetual laziness wasn't arleady preventing the required research... Link to comment Share on other sites More sharing options...
DaleHohm Posted January 5, 2006 Share Posted January 5, 2006 (edited) thanks again, i don't have access to msdn here at work so i couldn't have checked that stuff myself even if my perpetual laziness wasn't arleady preventing the required research... You have access to this forum, but not MSDN... yikesHere are some pointers when you do get connected: InternetExplorer Object, Frame Object, iFrame ObjectDale Edited January 5, 2006 by DaleHohm 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 Link to comment Share on other sites More sharing options...
seandisanti Posted January 5, 2006 Share Posted January 5, 2006 You have access to this forum, but not MSDN... yikesHere are some pointers when you do get connected: InternetExplorer Object, Frame Object, iFrame ObjectDalethanks! i actually decided to assume that i should have access to msdn and platform sdk to make the most efficient use of my time spent coding, and so have given myself access to those resources based on that determination.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now