Jump to content

Recommended Posts

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

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

Hi,

Indeed, the error appears in the two scripts.

But not every time, it looks very strange..

Thanks

FabFly

try declaring $IE_BO5US as global... that's the first thing that comes to mind since you're directly using it several functions...
Posted

Hi,

I've done it.

I'll give you the result tomorrow.

Thanks.

FabFly

cool, 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
Posted

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

Posted

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

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.

Posted

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

Posted

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

you're not able to test them real time?
Posted (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 
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

Posted

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

Posted

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

Posted

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
Posted (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... :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

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
  • Recently Browsing   0 members

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