Jump to content

_IELoadWait error


 Share

Recommended Posts

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.

FabFly

it 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

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

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

i will look at it again and let you know if i find anything....
Link to comment
Share on other sites

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

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 
Endfunc

Dale

Edited 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

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.

Dale

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).

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

EndIf

EndFunc

Link to comment
Share on other sites

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 :P

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

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 :lmao:

Let's see what we find out...

Dale

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... :P
Link to comment
Share on other sites

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... :P

You have access to this forum, but not MSDN... yikes

Here are some pointers when you do get connected: InternetExplorer Object, Frame Object, iFrame Object

Dale

Edited 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

You have access to this forum, but not MSDN... yikes

Here are some pointers when you do get connected: InternetExplorer Object, Frame Object, iFrame Object

Dale

thanks! 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.... :P
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...