Jump to content

Recommended Posts

Posted

I received the following error when trying to use _IEGetObjById on a browser object that I had obtained by using _IEAttach.

Shouldn't the code have gotten a 1 or 0 from IsObj and continued by returning with the standard message from _IEGetObjById that there was no match for the requested ID?
I'd appreciate any guidance on next steps to debug.

  Quote

"C:\Program Files\AutoIt3\Include\IE.au3" (1904) : ==> The requested action with this object has failed.:

If IsObj($oObject.document.getElementById($sID)) Then

If IsObj($oObject.document^ ERROR

->10:22:45 AutoIt3.exe ended.rc:1

+>10:22:45 AutoIt3Wrapper Finished.

>Exit code: 1    Time: 515.9

"C:\Program Files\AutoIt3\Include\IE.au3" (1904) : ==> The requested action with this object has failed.:

If IsObj($oObject.document.getElementById($sID)) Then

If IsObj($oObject.document^ ERROR

->10:22:45 AutoIt3.exe ended.rc:1

+>10:22:45 AutoIt3Wrapper Finished.

>Exit code: 1    Time: 515.9

 

Expand  

Posted

Read this:

 How to use IE.au3  UDF with  AutoIt v3.3.14.x  

And post here your example code and also SciTE console output.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Is that post saying that I MUST have my own error handler?
I don't really want my own error handler.

Isn't there error handling built in to IE.au3?

Regarding posting my code.

I don't know how to make a reproducer for this.
It is part of a very long program that just stops rather than returning the error code saying that there was no match for the ID I asked about.
Moreover, the ID is on the page when I use F12 to debug the source.

Phil

 

Posted (edited)
  On 3/30/2016 at 7:26 PM, philkryder said:

Is that post saying that I MUST have my own error handler?
I don't really want my own error handler.
 

Expand  

No you do not must have.
Then you do not know exactly what happend to your script - How you want to take this knowledge ?
And in Au3.3.14.x if you do not have COM error handler then in case COM error your script will be stopped with that error.

  On 3/30/2016 at 7:26 PM, philkryder said:

Isn't there error handling built in to IE.au3?

Expand  

Yes, and exactly in this link (given to you post #2)  I describe how to use them properly .
In current IE.au3 version    YOU MUST INITIATE this internal error handler , as IE.au3 have that error handler but not initiated.

 

  On 3/30/2016 at 7:26 PM, philkryder said:

Regarding posting my code.

I don't know how to make a reproducer for this.
It is part of a very long program that just stops rather than returning the error code saying that there was no match for the ID I asked about.
Moreover, the ID is on the page when I use F12 to debug the source.

Expand  

In that case , just post from SciTE console output some wider content because as I suppose the problem araise somewhere before.

This script told you that you are using wrong object as a parameter, or this object is not ready.

 

I think so as if you pass to:

_IEGetObjById(ByRef $oObject, $sID)

correct $oObject which should be ready, then you should not have problem with getting document object.

The _IELoadWait not always make the job in exactly that way as you suppose. So this object could still be "in progress".

 

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Thank you mLipok for helping me find a way to get more information.

I incorporated both your error handler and your enhanced load wait for all frames.

I then also added trace logic into the _IEGetObjById UDF.
I also use a brute force check to see that the page is fully loaded by using ^a and ^c to select and copy the entire page and check for a field at the end of the page before proceeding>

I now see err.number is:         0x80020008
and
Examination of the trace shows the error is created on line 1914 in _IEGetObjById which is shown below in context and is:
-->If IsObj($oObject.document.getElementById($sID)) Then

***what can I do to avoid this error?***
The ID is in fact on the page when I use F12 to inspect the code.

 

Func _IEGetObjById(ByRef $oObject, $sID)
    _pk_trace(".... in _IEGetObjById ... 1" & @CRLF)

    If Not IsObj($oObject) Then
        __IEConsoleWriteError("Error", "_IEGetObjById", "$_IESTATUS_InvalidDataType")
        Return SetError($_IESTATUS_InvalidDataType, 1, 0)
    EndIf

    _pk_trace(".... in _IEGetObjById ... 2" & @CRLF)
    ;
    If Not __IEIsObjType($oObject, "browserdom") Then
        __IEConsoleWriteError("Error", "_IEGetObById", "$_IESTATUS_InvalidObjectType")
        Return SetError($_IESTATUS_InvalidObjectType, 1, 0)
    EndIf
    _pk_trace(".... in _IEGetObjById ... 3" & @CRLF)
    ;
    If IsObj($oObject.document.getElementById($sID)) Then
        _pk_trace(".... in _IEGetObjById ... 4" & @CRLF)
        Return SetError($_IESTATUS_Success, 0, $oObject.document.getElementById($sID))
    Else
        _pk_trace(".... in _IEGetObjById ... 5" & @CRLF)
        __IEConsoleWriteError("Warning", "_IEGetObjById", "$_IESTATUS_NoMatch", $sID)
        Return SetError($_IESTATUS_NoMatch, 2, 0)
    EndIf
EndFunc   ;==>_IEGetObjById

 

 


 === 0000001267 --- 16.08.20  R:\Operations\MacroTools\_InterstateTransmittals\Programs\ProcessTransmittalsCentralPrintNo15_16.au3 (1914) : ==> COM Error intercepted !
    err.number is:         0x80020008
    err.windescription:    Bad variable type.

    err.description is:     
    err.source is:         
    err.helpfile is:     
    err.helpcontext is:     
    err.lastdllerror is:     0
    err.scriptline is:     1914
    err.retcode is:     0x00000000

.=== 0000001267

Posted

I guessing you are using AutoIt 3.3.14.x if so ..... Unfortunately I think this is probably the same problem as described here:
https://www.autoitscript.com/trac/autoit/ticket/3097

Try to compile with x64 version of 3.3.14.x
Or try your script with 3.3.12.x

And back with results.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Thanks mLipok 

Is there a way to get SCITE to run the x64 compiler?

I prefer to run with F5 for the better diagnostics rather than compile and execute an exe which makes the line numbers hard to fathom.

 

 

Posted

mLipok -

I ended up going back to 3.3.12

It sounds like this is a well know issue with Objects in 3.3.14
?Do you have any insight into plans for fix/revision?

 

  • Developers
Posted
  On 4/1/2016 at 4:36 PM, philkryder said:

s there any way to tell if in fact the compile was done for x64 when using F5 to run from SCITE?

Expand  

Sure, look at the OutputPane and see which aut2exe is used. It will be either aut2exe.exe or aut2exe_x64.exe.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

You can also use:

#AutoIt3Wrapper_UseX64=Y

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
×
×
  • Create New...