sqa

what is $_TESTATUS_InvalidObjectType

3 posts in this topic

#1 ·  Posted (edited)

I am really stuck with this.

#include<IE.au3>

local $oIE = _IEAttach("Application")   ; the name of Tab

local $oForm = _IEFormElementGetObjByName($oIE, "lastName")   ; "lastName" - <input name="lastName" class...>

 

running it,, there is an error: _IEFormElementGetObjByName, $_TESTATUS_InvalidObjectType

What's wrong?

Edited by sqa

Share this post


Link to post
Share on other sites



Have you create already an IE instance with string " Application " in its title?

 

You can try below function for getting an object with name.

_IEGetObjByName ( ByRef $oObject, $sName [, $iIndex = 0] )

 

Thanks

Anoop

Share this post


Link to post
Share on other sites

thanks, I didn't created it. Now it works

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

    • van_renier
      _IE functions, losing reference to object variable of an InternetExplorer.Application object
      By van_renier
      Could someone help me understand why I'm losing the object for certain _IE  user-functions (those included with Au3 v3.3.10.2)
      #include <IE.au3> ; Required for automatically entering login credentials to app manager GLOBAL $oIE $oIE = _IECreate("about:blank", 1) ; _IEQuit ($oIE) ; _IEQuit line HERE, it work, closing the browser... ConsoleWrite ("===============================" & @CRLF ) If WinExists ( "Blank Page - Windows Internet Explorer") <> 1 then While WinExists ("Blank Page - Windows Internet Explorer") <> 1 sleep ( 500 ) WEnd EndIf sleep ( 1200 ) ConsoleWrite ("===============================" & @CRLF ) ; _IEQuit ($oIE) ; _IEQuit line HERE, it work, closing the browser... ConsoleWrite ('This is where the object, $oIE, gets broken/lost' & @CRLF ) _IENavigate( $oIE, "http://www.msn.com" ) sleep (3000) ConsoleWrite ("===============================" & @CRLF ) sleep ( 5000 ) _IEQuit ($oIE) ; HERE FAILS, console error: "--> IE.au3 T3.0-1 Error from function _IEQuit, $_IEStatus_InvalidObjectType" exit In the above script, there are 3 lines with _IEQuit. The 1st 2 are commented out, but they work with closing the browser fine, but the 3rd line, fails to close out the browser window.
      (I'm not wanting to close out the browser window, but I was trying to figure out why subsequent calls lose the object variable reference of $oIE. Using _IEQuit seemed to be the easiest way to ensure we were attached to the same browser window.
      I've also noticed that using the above script, after the script exits (with the 3rd _IEQuit line intact), since the browser window is still open, if I try and enter any URL into the adress bar, pressing enter then causing a new browser window to open up.
      Any suggestions on why the object reference is getting broken?
      Thanks,
      Van
       
    • 6105
      IE Quit needed tabs
      By 6105
      Hi,

      Can't resolve a problem with killing needed attached tabs, always is killed 3 from 5.
      Here is 6 links, 5 need to be killed:


      #include <IE.au3> #include <String.au3> $oIE = _IECreate('facebook.com') __IENavigate($oIE, 'm.facebook.com', 0, 0x800) __IENavigate($oIE, 'm.facebook.com', 0, 0x800) __IENavigate($oIE, 'm.facebook.com', 0, 0x800) __IENavigate($oIE, 'm.facebook.com', 0, 0x800) __IENavigate($oIE, 'm.facebook.com', 0, 0x800) sleep(5000) Dim $aIE[1] Dim $aRE[1] $aIE[0] = 0 $aRE[0] = 0 $i = 1 While 1 $oIE = _IEAttach ("", "instance", $i) If @error = $_IEStatus_NoMatch Then ExitLoop ReDim $aIE[$i + 1] ReDim $aRE[$i + 1] $aIE[$i] = $oIE $get = _IEPropertyGet($oIE, "locationurl") $aRE[$i] = $get $aIE[0] = $i $check = _StringBetween($get, "m.", ".com") If not @error then $oIE = _IEAttach ("", "instance", $i) ConsoleWrite('Get = '&$get&@CRLF) _IEQuit($oIE) sleep(200) EndIf $i += 1 WEnd MsgBox(0, "Browsers Found", "Number of browser instances in the array: " & $aIE[0])

      Thank you in advance.
      Tedy.