philkryder

IsObj - The requested action with this object has failed.

13 posts in this topic

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

 

Share this post


Link to post
Share on other sites



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:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

1 hour ago, philkryder said:

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

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.

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

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.

 

1 hour ago, 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.

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:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

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.

 

 

Share this post


Link to post
Share on other sites

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?

 

Share this post


Link to post
Share on other sites

also,

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

Share this post


Link to post
Share on other sites
8 minutes ago, philkryder said:

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

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

Jos

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You can also use:

#AutoIt3Wrapper_UseX64=Y

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites
11 hours ago, Jos said:

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

Jos

Thanks Jos 

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

  • Similar Content

    • SkysLastChance
      By SkysLastChance
      I am not sure on how to grab the innertext I want. Is there a way I can just grab the second line, or is there a better way to do it all together? 
      #include <IE.au3> $oIE = _IEAttach("Form Details") $oDiv = _IEGetObjById($oIE, "Col3") ;Phone MsgBox (0,"Oops",$oDiv.outertext) When I use this code I get

       


       
      html.au3
    • Vishal85
      By Vishal85
      _IEGetObjById and _IEGetObjByName functions use variable of an InternetExplorer.Application, Window or Frame object as reference to find any dom element.

      Is it possible to use a dom element instead of InternetExplorer.Application, Window or Frame to find target dom element instead the dom element. This will help in finding elements using a parent child relationship where duplicate target dom elements exists on the HTML page.

      Other automation tools like WebDriver do have this feature. It would be great to have something like this in AutoIt. I love the way AutoIt works!!!!! Especially the IE UDF. Cool stuff from DALE and other developers.

      Ex - i would like to do something like this,

      $oIE = _IEAttach("Title")
      $oParentObject = _IEGetObjById($oIE, "Parent Widget or element Id which contains my target widget in its hierarchy below")
      $oTargetObject = _IEGetObjById(oParentObject , "Id of widget i would like to find and do some action")
      _IEAction($oTargetObject, "click")

      This will help in situations where there are widgets with duplicate ids on the page....Ex - 2 Add buttons with same id on the same page.....One add button to add a CAR...another Add button to add a Vehicle. In this case i cannot click on the exact Add button i want just with the Add button id. i will need reference of their immediate parent object to uniquely identify them.
    • Jury
      By Jury
      A search of a web page can retrieve 1 to 20 (or more) links split into 20 per page I can go on to the second page by using:


      If $x = 20 Then Sleep(2000) ;two seconds $oNext = _IEGetObjById($oIE, "pager1") _IEAction($oNext, "click") _IELoadWait($oIE)
      where $x is the count of links on the previous page but how do I get to the next page given the next page object is in javascript as seen here:


      <a id="pager1" href="javascript:__doPostBack('pager1','2')">2</a> -
      <a id="pager1" href="javascript:__doPostBack('pager1','3')">3</a> -
      <a id="pager1" href="javascript:__doPostBack('pager1','4')">4</a> -
      <a id="pager1" href="javascript:__doPostBack('pager1','5')">5</a>
      <a id="pager1" href="javascript:__doPostBack('pager1','2')">Next ></a>

      is there a way of sending the doPostBack('pager1','3') information? BTW I just thought (I.m not at my own PC) can I get IEGetObjById by index so somthing like that?