taylansan

Another iFrame and element question

22 posts in this topic

Hello,
I'm trying to set the value of an input value in an iframe which is a cross reference.

Here is my code:

$oFrame = _IEFrameGetObjByName($oIE, "AID_1460048722447_iframe")
If @error Then
    ConsoleWrite("Cannot get this frame" & @CRLF)
EndIf
If Not IsObj($oFrame) Then
    ConsoleWrite("Frame was not found" & @CRLF)
EndIf

;try each item one by one
$o1 = _IEGetObjById($oFrame, "serviceNo_input_value")
$o2 = _IEGetObjByName($oFrame, "searchCond.serviceNo")
$o3 = _IEFrameGetObjByName($oFrame, "searchCond.serviceNo")
$o4 = _IEFormGetObjByName($oFrame, "searchCond.serviceNo")
$o5 = _IEFormElementGetObjByName($oFrame, "searchCond.serviceNo")

This is the output for each $o1 to $o5 trying:

;result for $o1
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\Program Files\AutoIt3\Include\IE.au3" (1899) : ==> The requested action with this object has failed.:
If IsObj($oObject.document.getElementById($sID)) Then
If IsObj($oObject^ ERROR
->00:08:17 AutoIt3.exe ended.rc:1
+>00:08:17 AutoIt3Wrapper Finished.

;result for $o2
"C:\Program Files\AutoIt3\Include\IE.au3" (1875) : ==> The requested action with this object has failed.:
If IsObj($oObject.document.GetElementsByName($sName).item($iIndex)) Then
If IsObj($oObject^ ERROR
->00:09:49 AutoIt3.exe ended.rc:1
+>00:09:49 AutoIt3Wrapper Finished.

;result for $o3
"C:\Program Files\AutoIt3\Include\IE.au3" (704) : ==> The requested action with this object has failed.:
$oTemp = $oObject.document.parentWindow
$oTemp = $oObject^ ERROR
->00:10:18 AutoIt3.exe ended.rc:1
+>00:10:18 AutoIt3Wrapper Finished.

;result for $o4
"C:\Program Files\AutoIt3\Include\IE.au3" (930) : ==> The requested action with this object has failed.:
Local $oCol = $oObject.document.forms.item($sName)
Local $oCol = $oObject^ ERROR
->00:10:33 AutoIt3.exe ended.rc:1
+>00:10:33 AutoIt3Wrapper Finished.

;result for $o5
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType
+>00:10:49 AutoIt3.exe ended.rc:0
+>00:10:49 AutoIt3Wrapper Finished.

I have also checked these posts for reference, but I'm missing something which I cannot find.

I don't know how to copy the content of this html at once, so I provided in screenshot. Is there a way that I can get this element?

Source.png


TY.

Share this post


Link to post
Share on other sites



First - check if you got the correct iframe.

Then try something like this :
 

$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($oIE, $i)
    ;check here for the correct iframe
Next

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I have tried like this:

$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
ConsoleWrite("Total Frames: " & $iNumFrames & @CRLF)
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($oIE, $i)
    ;check here for the correct iframe
    If $oFrame.name <> "" Then ;ignore the empty names
        ConsoleWrite($oFrame.name & @CRLF)
    EndIf
Next

I have a lot of empty frames, and two frames only; home frame and AID_... Output is like that:

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Total Frames: 142
home_iframe
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" (18) : ==> The requested action with this object has failed.:
If $oFrame.name <> "" Then
If $oFrame^ ERROR
->12:01:42 AutoIt3.exe ended.rc:1
+>12:01:42 AutoIt3Wrapper Finished.

This is how it looks like, I'm trying to get AID_somenumber:

 

If I use _IEFrameGetCollection I cannot find my frame in the list, it's giving the error. So, I'm thinking that I cannot really get the frame with AID_...

I can find the AID number, how can I get into it? There are some input box which I want to reach.

My Frame DOM.png

My Frame Empty Items.png

Edited by taylansan
Posting the images

TY.

Share this post


Link to post
Share on other sites

Try this script and show me the output:

 

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
ConsoleWrite("Total Frames: " & $iNumFrames & @CRLF)
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($oIE, $i)
    ConsoleWrite("number"&$i&":"&$oFrame.name & @CRLF)
Next

Func MyErrFunc()
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    $g_eventerror = $err  ; to check for after this function returns
Endfunc

Share this post


Link to post
Share on other sites

Hi Juvigy,

Here is the output. All of the frames are blank. There is one home frame:

>"C:\Program Files\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" /UserParams    
+>15:21:03 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X86  Environment(Language:0409)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => C:\Program Files\AutoIt3\SciTE   UserDir => C:\Users\t00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\t00722811\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files\AutoIt3  input:D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3
+>15:21:03 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Total Frames: 142
number0:
number1:
number2:
number3:
number4:
number5:
number6:
number7:
number8:
number9:
number10:
number11:
number12:
number13:
number14:
number15:
number16:
number17:
number18:
number19:
number20:
number21:
number22:
number23:
number24:
number25:
number26:
number27:
number28:
number29:
number30:
number31:
number32:
number33:
number34:
number35:
number36:
number37:
number38:
number39:
number40:
number41:
number42:
number43:
number44:
number45:
number46:
number47:
number48:
number49:
number50:
number51:
number52:
number53:
number54:
number55:
number56:
number57:
number58:
number59:
number60:
number61:
number62:
number63:
number64:
number65:
number66:
number67:
number68:
number69:
number70:
number71:
number72:
number73:
number74:
number75:
number76:
number77:
number78:
number79:
number80:
number81:
number82:
number83:
number84:
number85:
number86:
number87:
number88:
number89:
number90:
number91:
number92:
number93:
number94:
number95:
number96:
number97:
number98:
number99:
number100:
number101:
number102:
number103:
number104:
number105:
number106:
number107:
number108:
number109:
number110:
number111:
number112:
number113:
number114:
number115:
number116:
number117:
number118:
number119:
number120:
number121:
number122:
number123:
number124:
number125:
number126:
number127:
number128:
number129:
number130:
number131:
number132:
number133:
number134:
number135:
number136:
number137:
number138:
number139:
number140:home_iframe
number141:
+>15:21:06 AutoIt3.exe ended.rc:0
+>15:21:06 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 3.847

In the debugger for IE, I can see the iframe with AID_1460110786614_iframe, but it's not shown in the output. And attached the screenshot.

Thank you very much for your efforts so far.

142 Frames.png


TY.

Share this post


Link to post
Share on other sites

So you will need to get the DIV first , and then the iframe inside.

Try:

        $oArray = $oDoc.getElementsByTagName ("div")
            For $element In $oArray
                    ConsoleWrite( $element.id &@CRLF)
            Next

And look for the AID_16... id.

Share this post


Link to post
Share on other sites

Using this, gives the following error that $oDoc not defined:

$oArray = $oDoc.getElementsByTagName("div")
For $element In $oArray
    ConsoleWrite( $element.id & @CRLF)
Next 


>Running AU3Check (3.3.14.2)  from:C:\Program Files\AutoIt3  input:D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"(11,44) : warning: $oDoc: possibly used before declaration.
$oArray = $oDoc.getElementsByTagName("div")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"(11,44) : error: $oDoc: undeclared global variable.
$oArray = $oDoc.getElementsByTagName("div")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3 - 1 error(s), 1 warning(s)
!>17:55:41 AU3Check ended. Press F4 to jump to next error.rc:2
+>17:55:41 AutoIt3Wrapper Finished.

The doc variable is not defined, so I changed it with oIE (just for trying - don't know hot to set oDoc):

$oArray = $oIE.getElementsByTagName("div")
For $element In $oArray
    ConsoleWrite( $element.id & @CRLF)
Next


>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" (11) : ==> The requested action with this object has failed.:
$oArray = $oIE.getElementsByTagName("div")
$oArray = $oIE^ ERROR
->17:58:04 AutoIt3.exe ended.rc:1
+>17:58:04 AutoIt3Wrapper Finished.

Then tried to get the "div" using normal function:

Local $oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If $oInput.id = "AID_1460110786614" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )

        _IEAction($oInput, "focus") ;trying focus for any luck

        $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
        $oFrames = _IEFrameGetCollection ($oInput)
        $iNumFrames = @extended
        ConsoleWrite("Total Frames: " & $iNumFrames & @CRLF)
        For $i = 0 to ($iNumFrames - 1)
            $oFrame = _IEFrameGetCollection ($oInput, $i)
            ConsoleWrite("number"&$i&":"&$oFrame.name & @CRLF)
        Next

    EndIf
Next

Func MyErrFunc()
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    $g_eventerror = $err  ; to check for after this function returns
Endfunc



>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Okay inside that div: AID_1460110786614
Total Frames: 142
number0:
number1:
number2:
number3:
number4:
number5:
number6:
number7:
number8:
number9:
number10:
number11:
number12:
number13:
number14:
number15:
number16:
number17:
number18:
number19:
number20:
number21:
number22:
number23:
number24:
number25:
number26:
number27:
number28:
number29:
number30:
number31:
number32:
number33:
number34:
number35:
number36:
number37:
number38:
number39:
number40:
number41:
number42:
number43:
number44:
number45:
number46:
number47:
number48:
number49:
number50:
number51:
number52:
number53:
number54:
number55:
number56:
number57:
number58:
number59:
number60:
number61:
number62:
number63:
number64:
number65:
number66:
number67:
number68:
number69:
number70:
number71:
number72:
number73:
number74:
number75:
number76:
number77:
number78:
number79:
number80:
number81:
number82:
number83:
number84:
number85:
number86:
number87:
number88:
number89:
number90:
number91:
number92:
number93:
number94:
number95:
number96:
number97:
number98:
number99:
number100:
number101:
number102:
number103:
number104:
number105:
number106:
number107:
number108:
number109:
number110:
number111:
number112:
number113:
number114:
number115:
number116:
number117:
number118:
number119:
number120:
number121:
number122:
number123:
number124:
number125:
number126:
number127:
number128:
number129:
number130:
number131:
number132:
number133:
number134:
number135:
number136:
number137:
number138:
number139:
number140:home_iframe
number141:
+>18:07:36 AutoIt3.exe ended.rc:0
+>18:07:36 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 7.308

Should I get all the div one by one? div: tabpage_body > div: AID_1460110786614_body > div: AID_1460110786614 > iframe: AID_1460110786614_iframe (according to the previous screenshots)

What am I missing?


TY.

Share this post


Link to post
Share on other sites

@taylansan can we check some stuff first?

IMPORTANT: please check and recheck the ID's name, make sure they are right. Just use this code, nothing else, open the website you trying to automate, make sure there is no other instance of the IE runnnig, ok?

Try this and post the console output.

#include <IE.au3>

$oIE = _IEAttach("", "instance", 1)
ConsoleWrite("IsObj($oIE) = " & IsObj($oIE) & @CRLF)
$1_div = $oIE.document.getElementById("tabpage_body")
ConsoleWrite("IsObj($1_div) = " & IsObj($1_div) & @CRLF)
$1_frame = $oIE.document.getElementById("AID_1460048722447_iframe")
ConsoleWrite("IsObj($1_div) = " & IsObj($1_frame) & @CRLF)
$1_input = $oIE.document.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($1_input) = " & IsObj($1_input) & @CRLF)

ConsoleWrite("------------ #### ------------" & @CRLF)

$2_frame = $oIE.document.getElementById("AID_1460048722447_iframe")
ConsoleWrite("IsObj($2_frame) = " & IsObj($2_frame) & @CRLF)
$2_frame_doc = $2_frame.contentWindow.document
ConsoleWrite("IsObj($2_frame_doc) = " & IsObj($2_frame_doc) & @CRLF)
$2_input = $2_frame_doc.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($2_input) = " & IsObj($2_input) & @CRLF)

Exit

 

Share this post


Link to post
Share on other sites

I'd say give this a try and see if it spits out the data your looking for.   This will most likely needed edited to fit into your script 

#include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IE_Example("basic") Local $sHTML = _IEDocReadHTML($oIE) MsgBox($MB_SYSTEMMODAL, "Document Source", $sHTML) _IEQuit($oIE)

 

Share this post


Link to post
Share on other sites

@markyrocks i belive he is trying to set input value/text in a form, not trying to read it. :)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I have only changed the AID_ because it always changes:

$oIE = _IEAttach("", "instance", 1)
ConsoleWrite("IsObj($oIE) = " & IsObj($oIE) & @CRLF)
$1_div = $oIE.document.getElementById("tabpage_body")
ConsoleWrite("IsObj($1_div) = " & IsObj($1_div) & @CRLF)
$1_frame = $oIE.document.getElementById("AID_1460110786614_iframe")
ConsoleWrite("IsObj($1_div) = " & IsObj($1_frame) & @CRLF)
$1_input = $oIE.document.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($1_input) = " & IsObj($1_input) & @CRLF)

ConsoleWrite("------------ #### ------------" & @CRLF)

$2_frame = $oIE.document.getElementById("AID_1460110786614_iframe")
ConsoleWrite("IsObj($2_frame) = " & IsObj($2_frame) & @CRLF)
$2_frame_doc = $2_frame.contentWindow.document
ConsoleWrite("IsObj($2_frame_doc) = " & IsObj($2_frame_doc) & @CRLF)
$2_input = $2_frame_doc.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($2_input) = " & IsObj($2_input) & @CRLF)



>Running AU3Check (3.3.14.2)  from:C:\Program Files\AutoIt3  input:D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3
+>19:41:04 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
IsObj($oIE) = 1
IsObj($1_div) = 1
IsObj($1_div) = 1
IsObj($1_input) = 0
------------ #### ------------
IsObj($2_frame) = 1
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" (23) : ==> The requested action with this object has failed.:
$2_frame_doc = $2_frame.contentWindow.document
$2_frame_doc = $2_frame.contentWindow^ ERROR
->19:41:05 AutoIt3.exe ended.rc:1
+>19:41:05 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 2.321

I have tried with the second way too, but the output is very big. I cannot post the output because browser crashes.

The ID is the same and okay, and there is no other internet explorer instance
Because I can see that: tabpage_body ok > AID_1460110786614_iframe ok > serviceNo_input_value not ok
And yes, I'm trying to put some value into that input box after I can get the object. Because if I can get the object from this frame, I can also get other objects in the same frame too; can set the value or reading the value will be okay

Edited by taylansan
My post didn't go, so I write again

TY.

Share this post


Link to post
Share on other sites
1 minute ago, MichaelHB said:

@markyrocks i belive he is trying to set input value/text in a form, not trying to read it. :)

Ya no doubt but at this point he's not able to get the object.   I'm was trying to get back to basics here.  If the object doesn't show up in the example I posted I doubt would even be possible to get the object.  If it was an input he should be using _ieformgetobjbyname()

Share this post


Link to post
Share on other sites

@taylansan sorry for the late reply. :)

Try this and post the output.

#include <IE.au3>

$Value = "" ; put the value between the "" you want to set. Be sure its the value of the input you want to change
            ; and its a correct type, some forms validate the value.

$oIE = _IEAttach("", "instance", 1)
If Not IsObj($oIE) Then Exit ConsoleWrite("IsObj($oIE) = " & IsObj($oIE) & @CRLF)

$Frame = $oIE.document.getElementById("AID_1460110786614_iframe")
ConsoleWrite("IsObj($Frame) = " & IsObj($Frame) & @CRLF)

$Frame_Content = $Frame.contentDocument
ConsoleWrite("IsObj($Frame_Content) = " & IsObj($Frame_Content) & @CRLF)

$Input = $Frame_Content.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($Input) = " & IsObj($Input) & @CRLF)

If IsObj($Input) Then $Input.value = $Value

Exit

 

Share this post


Link to post
Share on other sites

@MichaelHB Late reply is okay, I'm late too. Actually thank you for the reply. 

This is the output:

$Value = "" ; put the value between the "" you want to set. Be sure its the value of the input you want to change
            ; and its a correct type, some forms validate the value.

$oIE = _IEAttach("", "instance", 1)
If Not IsObj($oIE) Then Exit ConsoleWrite("IsObj($oIE) = " & IsObj($oIE) & @CRLF)

$Frame = $oIE.document.getElementById("AID_1460354248311_iframe") ;<===== Changed this only because it always changes
ConsoleWrite("IsObj($Frame) = " & IsObj($Frame) & @CRLF)

$Frame_Content = $Frame.contentDocument
ConsoleWrite("IsObj($Frame_Content) = " & IsObj($Frame_Content) & @CRLF)

$Input = $Frame_Content.getElementById("serviceNo_input_value")
ConsoleWrite("IsObj($Input) = " & IsObj($Input) & @CRLF)

If IsObj($Input) Then $Input.value = $Value

Exit



>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
IsObj($Frame) = 1
"D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3" (18) : ==> The requested action with this object has failed.:
$Frame_Content = $Frame.contentDocument
$Frame_Content = $Frame^ ERROR
->11:01:00 AutoIt3.exe ended.rc:1
+>11:01:00 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 0.726

I can get the frame for AID, but I cannot go inside...

I think there is way to read that iframe.


TY.

Share this post


Link to post
Share on other sites

Ok , so we have progress, there are 2 nested divs with the same ID. SO try this one:

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If StringLeft($oInput.id,4) = "AID_" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )      
        $oInputs2 = _IETagNameGetCollection($oInput, "div")
            For $oInput2 In $oInputs2
                If $oInput2.id = $oInput.id Then ;to check if it's the correct div2
                    ConsoleWrite("Okay inside that div2: " & $oInput2.id & @CRLF )
                EndIf
            Next    
    EndIf
Next

Func MyErrFunc()
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    $g_eventerror = $err  ; to check for after this function returns
Endfunc

Share this post


Link to post
Share on other sites

@Juvigy Here is the output

>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460354248311_title
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460354248311_close
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460354248311_body
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460354248311
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
+>13:54:41 AutoIt3.exe ended.rc:0
+>13:54:41 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.701

There are four "Okay inside div", but cannot see any "div2"

So far I have understood the logic, but I couldn't get the reason why we check 2nd div after finding and inside the 1st div


TY.

Share this post


Link to post
Share on other sites

We want to get to the second DIV which is inside the first one. In the second DIV is the IFRAME.  This is how i see it in the code screenshot.

Try it like this:

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If StringLeft($oInput.id,4) = "AID_" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )      
        $oInputs2 = _IETagNameGetCollection($oInput, "div")
            For $oInput2 In $oInputs2
                ConsoleWrite("Div2: " & $oInput2.id & @CRLF )
            Next    
    EndIf
Next

Func MyErrFunc()
    Local $err = $oMyError.number
    If $err = 0 Then $err = -1
    $g_eventerror = $err  ; to check for after this function returns
Endfunc

 

Share this post


Link to post
Share on other sites

Here we can get inside the second DIV

$oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If StringLeft($oInput.id,4) = "AID_" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )
        $oInputs2 = _IETagNameGetCollection($oInput, "div")
        For $oInput2 In $oInputs2
            ConsoleWrite("Div2: " & $oInput2.id & @CRLF )
            ; <==== I have edeted here
            If $oInput2.id = "AID_1460373684268" Then
                ConsoleWrite("It's okay we found this" & @CRLF)
                $Frame = $oInput2.document.getElementById("AID_1460373684268_iframe")
                ConsoleWrite("IsObj($Frame) = " & IsObj($Frame) & @CRLF)
                $o1 = _IEGetObjById($Frame, "serviceNo_input_value")
                $o2 = _IEGetObjByName($Frame, "searchCond.serviceNo")
                $o3 = _IEFrameGetObjByName($Frame, "searchCond.serviceNo")
                $o4 = _IEFormGetObjByName($Frame, "searchCond.serviceNo")
                $o5 = _IEFormElementGetObjByName($Frame, "searchCond.serviceNo")
            EndIf
            ; <==== Until here
        Next
    EndIf
Next



>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Okay inside that div: AID_1460373684268_title
Okay inside that div: AID_1460373684268_close
Okay inside that div: AID_1460373684268_body
Div2: AID_1460373684268
It's okay we found this
IsObj($Frame) = 1
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (serviceNo_input_value)
--> IE.au3 T3.0-2 Warning from function _IEGetObjByName, $_IESTATUS_NoMatch (Name: searchCond.serviceNo, Index: 0)
--> IE.au3 T3.0-2 Warning from function _IEFrameGetObjByName, $_IESTATUS_NoMatch (No frames matching name)
--> IE.au3 T3.0-2 Warning from function _IEFormGetObjByName, $_IESTATUS_NoMatch
--> IE.au3 T3.0-2 Error from function _IEFormElementGetObjByName, $_IESTATUS_InvalidObjectType
Okay inside that div: AID_1460373684268
+>16:23:55 AutoIt3.exe ended.rc:0
+>16:23:55 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.546

I have made a few other tries without modifying your suggestion - I didn't know if it would be successful, so I have tried all the 5 ways to get an object, but all failed

Also thank you for explaining the logic for going inside these two DIVs :)


TY.

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

Now that you have the second DIV , use it to get the iframe inside :

$oFrames = _IEFrameGetCollection ($div2)
$iNumFrames = @extended
For $i = 0 to ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection ($div2, $i)
    ;check here for the correct iframe
Next
Edited by Juvigy
spell check

Share this post


Link to post
Share on other sites

The frame didn't come (I assumed to use $oInput2, am I correct?)

$oInputs = _IETagNameGetCollection($oIE, "div")
For $oInput In $oInputs
    If StringLeft($oInput.id,4) = "AID_" Then ;to check if it's the correct div
        ConsoleWrite("Okay inside that div: " & $oInput.id & @CRLF )
        $oInputs2 = _IETagNameGetCollection($oInput, "div")
        For $oInput2 In $oInputs2
            ConsoleWrite("Div2: " & $oInput2.id & @CRLF )
            $oFrames = _IEFrameGetCollection($oInput2)
            $iNumFrames = @extended
            ConsoleWrite("Number of frames: " & $iNumFrames & @CRLF)
            For $i = 0 to ($iNumFrames - 1)
                $oFrame = _IEFrameGetCollection($oInput2, $i)
                ;check here for the correct iframe
                ConsoleWrite("Now i: " & $i & " Name: " & $oFrame.name & " ID: " & $oFrame.id & @CRLF)
            Next
        Next
    EndIf
Next



>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Browser\TimesMe\TimesMe.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460390960355_title
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460390960355_close
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Okay inside that div: AID_1460390960355_body
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
Div2: AID_1460390960355
Number of frames: 142
Now i: 0 Name:  ID: 
Now i: 1 Name:  ID: 
Now i: 2 Name:  ID: 
Now i: 3 Name:  ID: 
Now i: 4 Name:  ID: 
Now i: 5 Name:  ID: 
Now i: 6 Name:  ID: 
Now i: 7 Name:  ID: 
Now i: 8 Name:  ID: 
Now i: 9 Name:  ID: 
Now i: 10 Name:  ID: 
Now i: 11 Name:  ID: 
Now i: 12 Name:  ID: 
Now i: 13 Name:  ID: 
Now i: 14 Name:  ID: 
Now i: 15 Name:  ID: 
Now i: 16 Name:  ID: 
Now i: 17 Name:  ID: 
Now i: 18 Name:  ID: 
Now i: 19 Name:  ID: 
Now i: 20 Name:  ID: 
Now i: 21 Name:  ID: 
Now i: 22 Name:  ID: 
Now i: 23 Name:  ID: 
Now i: 24 Name:  ID: 
Now i: 25 Name:  ID: 
Now i: 26 Name:  ID: 
Now i: 27 Name:  ID: 
Now i: 28 Name:  ID: 
Now i: 29 Name:  ID: 
Now i: 30 Name:  ID: 
Now i: 31 Name:  ID: 
Now i: 32 Name:  ID: 
Now i: 33 Name:  ID: 
Now i: 34 Name:  ID: 
Now i: 35 Name:  ID: 
Now i: 36 Name:  ID: 
Now i: 37 Name:  ID: 
Now i: 38 Name:  ID: 
Now i: 39 Name:  ID: 
Now i: 40 Name:  ID: 
Now i: 41 Name:  ID: 
Now i: 42 Name:  ID: 
Now i: 43 Name:  ID: 
Now i: 44 Name:  ID: 
Now i: 45 Name:  ID: 
Now i: 46 Name:  ID: 
Now i: 47 Name:  ID: 
Now i: 48 Name:  ID: 
Now i: 49 Name:  ID: 
Now i: 50 Name:  ID: 
Now i: 51 Name:  ID: 
Now i: 52 Name:  ID: 
Now i: 53 Name:  ID: 
Now i: 54 Name:  ID: 
Now i: 55 Name:  ID: 
Now i: 56 Name:  ID: 
Now i: 57 Name:  ID: 
Now i: 58 Name:  ID: 
Now i: 59 Name:  ID: 
Now i: 60 Name:  ID: 
Now i: 61 Name:  ID: 
Now i: 62 Name:  ID: 
Now i: 63 Name:  ID: 
Now i: 64 Name:  ID: 
Now i: 65 Name:  ID: 
Now i: 66 Name:  ID: 
Now i: 67 Name:  ID: 
Now i: 68 Name:  ID: 
Now i: 69 Name:  ID: 
Now i: 70 Name:  ID: 
Now i: 71 Name:  ID: 
Now i: 72 Name:  ID: 
Now i: 73 Name:  ID: 
Now i: 74 Name:  ID: 
Now i: 75 Name:  ID: 
Now i: 76 Name:  ID: 
Now i: 77 Name:  ID: 
Now i: 78 Name:  ID: 
Now i: 79 Name:  ID: 
Now i: 80 Name:  ID: 
Now i: 81 Name:  ID: 
Now i: 82 Name:  ID: 
Now i: 83 Name:  ID: 
Now i: 84 Name:  ID: 
Now i: 85 Name:  ID: 
Now i: 86 Name:  ID: 
Now i: 87 Name:  ID: 
Now i: 88 Name:  ID: 
Now i: 89 Name:  ID: 
Now i: 90 Name:  ID: 
Now i: 91 Name:  ID: 
Now i: 92 Name:  ID: 
Now i: 93 Name:  ID: 
Now i: 94 Name:  ID: 
Now i: 95 Name:  ID: 
Now i: 96 Name:  ID: 
Now i: 97 Name:  ID: 
Now i: 98 Name:  ID: 
Now i: 99 Name:  ID: 
Now i: 100 Name:  ID: 
Now i: 101 Name:  ID: 
Now i: 102 Name:  ID: 
Now i: 103 Name:  ID: 
Now i: 104 Name:  ID: 
Now i: 105 Name:  ID: 
Now i: 106 Name:  ID: 
Now i: 107 Name:  ID: 
Now i: 108 Name:  ID: 
Now i: 109 Name:  ID: 
Now i: 110 Name:  ID: 
Now i: 111 Name:  ID: 
Now i: 112 Name:  ID: 
Now i: 113 Name:  ID: 
Now i: 114 Name:  ID: 
Now i: 115 Name:  ID: 
Now i: 116 Name:  ID: 
Now i: 117 Name:  ID: 
Now i: 118 Name:  ID: 
Now i: 119 Name:  ID: 
Now i: 120 Name:  ID: 
Now i: 121 Name:  ID: 
Now i: 122 Name:  ID: 
Now i: 123 Name:  ID: 
Now i: 124 Name:  ID: 
Now i: 125 Name:  ID: 
Now i: 126 Name:  ID: 
Now i: 127 Name:  ID: 
Now i: 128 Name:  ID: 
Now i: 129 Name:  ID: 
Now i: 130 Name:  ID: 
Now i: 131 Name:  ID: 
Now i: 132 Name:  ID: 
Now i: 133 Name:  ID: 
Now i: 134 Name:  ID: 
Now i: 135 Name:  ID: 
Now i: 136 Name:  ID: 
Now i: 137 Name:  ID: 
Now i: 138 Name:  ID: 
Now i: 139 Name:  ID: 
Now i: 140 Name: home_iframe ID: 
Now i: 141 Name:  ID: 
Okay inside that div: AID_1460390960355
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
--> IE.au3 T3.0-2 Warning from function internal function __IEIsObjType, Cannot register internal error handler, cannot trap COM errors (Use _IEErrorHandlerRegister() to register a user error handler)
+>21:22:36 AutoIt3.exe ended.rc:0
+>21:22:36 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 1.931

Even if inside the DIV, I'm unable to get that frame ID or name. But in the above screenshot, I'm able to that the frame name / ID actually exists


TY.

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

    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      Before all, I want to say that I'm doing this script to see how _IE* functions work, and see if my studs can hack a quiz I'm working on.
      I want to clarify that I'm not automating any game, bypassing any CAPTCHAs, or anything that could damage anyone.
      I was trying to autofill a form, based on which question is displayed.
      The question is always stored in here:
      <header> <h1><span class="questionid">1. </span>Here goes the question</h1> </header> And answers are stored in here:
      <ul class="answers"> <li><label><span><input id="answer_0" name="answer[]" type="radio" value="0">Answer 1</span></label></li> <li><label><span><input id="answer_1" name="answer[]" type="radio" value="1">Answer 2</span></label></li> <li><label><span><input id="answer_2" name="answer[]" type="radio" value="2">Anwser 3</span></label></li> <li><label><span><input id="answer_3" name="answer[]" type="radio" value="3">Answer 4</span></label></li> </ul></fieldset></form></div> And, there are 15 questions like this.
      How can automatically fill my form?
      Thanks in advance
      Francesco
    • Omnitica
      By Omnitica
      Hello!
      I'm new to the forums! Couldn't find any threads covering this issue. Sorry if I'm wrong.

      I'm having problems changing the text/value of a input box. The particular box doesn't have a name or id, just: class="jq_hotkeys_enabled form-control".
      This class appears multiple times throughout the source, so I don't think It's right to reference that object. 
      See image 1.
      However, I've managed to find a object with the name "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper" which contains the value of the input box, and the id for the person in the dropdown/combobox left of it. (with "dummy-1" selected).
      See image 2.
      As you can see the value is 3982,4545     ( name , time )
      But when I try to change the value of it by doing:
      #include <IE.au3> Local $oIE = _IEAttach(WinGetHandle("[CLASS:IEFrame]"),"embedded") Local $oForm = _IEFormGetObjByName($oIE, "aspnetForm") Local $oInput = _IEFormElementGetObjByName($oForm, "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper") _IEFormElementSetValue($oInput, "3982,1337") The box doesn't get its new value. I  can see in the source that it's changed though.
      See image 3.
       
      However, if I do: 
      #include <IE.au3> Local $oIE = _IEAttach(WinGetHandle("[CLASS:IEFrame]"),"embedded") Local $oForm = _IEFormGetObjByName($oIE, "aspnetForm") Local $oInput = _IEFormElementGetObjByName($oForm, "ctl00$content$ctrl$ucServiceTime$rpServicetimes$ctl00$edtHiddenResourceHelper") _IEFormElementSetValue($oInput, "3982,1337") $oIE.document.parentwindow.execScript("theForm.submit()") ; But it needs to reload the page The box gets its new value after the page reloads by the theForm.submit() function. 
      This is a bit unfortunate as I want the changes to happen instantly like when I type in the box with the keyboard... or select in the combobox.
      Maybe someone knows how I can do this? Looking forward to an answer! 
      Thanks in advance.
       
      Note: Unfortunately I can't provide with the real URL as it is constricted to employees in the company I work for, but let me know If I should provide anything else.
       



    • ur
      By ur
      For the below form, I am able to automate using below code for textboxes.

      #include <IE.au3> Local $oIE = _IEAttach("http://localhost:18170/MartAdmin/", "url") _IELoadWait($oIE) $Search = _IEGetObjById($oIE,"x-auto-16-input") _IEPropertySet($Search, 'innerText','Uday KIran') $Search = _IEGetObjById($oIE,"x-auto-18-input") _IEPropertySet($Search, 'innerText','Uday KIran') But for the Login button, there is no id or name.
      The html code when I click on Inspect element in browser, shown below.
      <button tabindex="0" class="x-btn-text" style="width: 64px; position: relative;" type="button">Log In</button> Please let me know how to click this.?
       
    • jonson1986
      By jonson1986
      Hey,
      I'm trying to select language from drop-down menu on a webpage by _IEGetObjById but it's  not working, It mean autoit open the page but unable to select my desired value not even by matching text or by value, I'm looking for kind help...I've pastes my Autoit codes below along with source codes(using ie) of the webpage ;
      #include <IE.au3> $site = "http://example.com/upload" $oIE = _IECreate($site) $oDownloadSamples = _IEGetObjById($oIE, "language") $oDownloadSamplesSelect = _IETagNameGetCollection($oDownloadSamples, "select", "language") $oDownloadSamplesSelect.focus _IEFormElementOptionSelect($oDownloadSamplesSelect, "French", 1, "byText") Sleep (1000) _IEFormElementOptionSelect($oDownloadSamplesSelect, "2", 1, "byValue") HTML Codes using IE:
      <html> <head> <div class="form-row"> <div class="col-7"> <label>Language</label> <select name="language" class="select" id="language"> <option value="1">English</option> <option value="2">French</option> <option value="3">German</option> <option value="4">Italian</option> <option value="5">Japanese</option> <option value="6">Spanish</option> <option value="7">Russian</option> <option value="8">Hindi</option> <option value="9">Arabic</option> <option value="10">Chinese</option> <option value="11">Dutch</option> <option value="12">Finnish</option> <option value="13">Korean</option> <option value="14">Norwegian</option> <option value="15">Portuguese</option> <option value="16">Romanian</option> <option value="17">Serbian</option> <option value="18">Croatian</option> <option value="20">Polish</option> <option value="21">Afar</option> <option value="22">Abkhazian</option> <option value="23">Afrikaans</option> <option value="24">Amharic</option> <option value="25">Assamese</option> <option value="26">Aymara</option> <option value="27">Azerbaijani</option> <option value="28">Bashkir</option> <option value="29">Belarusian</option> <option value="30">Bulgarian</option> <option value="31">Bihari</option> <option value="32">Bislama</option> <option value="33">Bengali/Bangla</option> <option value="34">Tibetan</option> <option value="35">Breton</option> <option value="36">Catalan</option> <option value="37">Corsican</option> <option value="38">Czech</option> <option value="39">Welsh</option> <option value="40">Danish</option> <option value="41">Bhutani</option> <option value="42">Greek</option> <option value="43">Esperanto</option> <option value="44">Estonian</option> <option value="45">Basque</option> <option value="46">Persian</option> <option value="47">Fiji</option> <option value="48">Faeroese</option> <option value="49">Frisian</option> <option value="50">Irish</option> <option value="51">Scots/Gaelic</option> <option value="52">Galician</option> <option value="53">Guarani</option> <option value="54">Gujarati</option> <option value="55">Hausa</option> <option value="56">Hungarian</option> <option value="57">Armenian</option> <option value="58">Interlingua</option> <option value="59">Interlingue</option> <option value="60">Inupiak</option> <option value="61">Indonesian</option> <option value="62">Icelandic</option> <option value="63">Hebrew</option> <option value="64">Yiddish</option> <option value="65">Javanese</option> <option value="66">Georgian</option> <option value="67">Kazakh</option> <option value="68">Greenlandic</option> <option value="69">Cambodian</option> <option value="70">Kannada</option> <option value="71">Kashmiri</option> <option value="72">Kurdish</option> <option value="73">Kirghiz</option> <option value="74">Latin</option> <option value="75">Lingala</option> <option value="76">Laothian</option> <option value="77">Lithuanian</option> <option value="78">Latvian/Lettish</option> <option value="79">Malagasy</option> <option value="80">Maori</option> <option value="81">Macedonian</option> <option value="82">Malayalam</option> <option value="83">Mongolian</option> <option value="84">Moldavian</option> <option value="85">Marathi</option> <option value="86">Malay</option> <option value="87">Maltese</option> <option value="88">Burmese</option> <option value="89">Nauru</option> <option value="90">Nepali</option> <option value="91">Occitan</option> <option value="92">(Afan)/Oromoor/Oriya</option> <option value="93">Punjabi</option> <option value="94">Pashto/Pushto</option> <option value="95">Quechua</option> <option value="96">Rhaeto-Romance</option> <option value="97">Kirundi</option> <option value="98">Kinyarwanda</option> <option value="99">Sanskrit</option> <option value="100">Sindhi</option> <option value="101">Sangro</option> <option value="102">Serbo-Croatian</option> <option value="103">Singhalese</option> <option value="104">Slovak</option> <option value="105">Slovenian</option> <option value="106">Samoan</option> <option value="107">Shona</option> <option value="108">Somali</option> <option value="109">Albanian</option> <option value="110">Siswati</option> <option value="111">Sesotho</option> <option value="112">Sundanese</option> <option value="113">Swedish</option> <option value="114">Swahili</option> <option value="115">Tamil</option> <option value="116">Telugu</option> <option value="117">Tajik</option> <option value="118">Thai</option> <option value="119">Tigrinya</option> <option value="120">Turkmen</option> <option value="121">Tagalog</option> <option value="122">Setswana</option> <option value="123">Tonga</option> <option value="124">Turkish</option> <option value="125">Tsonga</option> <option value="126">Tatar</option> <option value="127">Twi</option> <option value="128">Ukrainian</option> <option value="129">Urdu</option> <option value="130">Uzbek</option> <option value="131">Vietnamese</option> <option value="132">Volapuk</option> <option value="133">Wolof</option> <option value="134">Xhosa</option> <option value="135">Yoruba</option> <option value="136">Zulu</option> <option value="19">Other</option> </select> </div> </main> </body> </html>  
    • kawliga751
      By kawliga751
      I am trying to script the opening of multiple tabs in IE with each tab having a separate login/password. I have been able to make a successful script that will open 3 separate IE sessions with the correct webpage and login or a script that will open 3 tabs in one session (which I want) but will not login. I have tried _IECreate, IEAttach etc. This is the script I am currently using . 
      #include <IE.au3> Const $navOpenInNewTab = 0x0800 Dim $oIE = _IECreate('http://asag.xxxxxxx.com/AAAA/index.htm') ;$o_IE.Navigate2('http://asag.xxxxxxx.com/apps/yyyyyyy/LogInSAG/login.asp', $navOpenInNewTab) ;$o_IE.Navigate2('http://asag.xxxxxxx.com/apps/yyyyyyy/LogInSAG/login.asp', $navOpenInNewTab) Call ("YYYYYYYSignIn") Func YYYYYYYSignIn () Local $username = _IEGetObjByName ($oIE,"uname") Local $password = _IEGetObjByName ($oIE,"pword") $oIE.Navigate2('http://asag.xxxxxxx.com/apps/xxxxxxx/LogInSAG/login.asp',2048) _IEFormElementSetValue ($username, "xxxxxxx") _IEFormElementSetValue ($password, "xxxxxxx") Send('{Enter}') EndFunc Call ("xxxxxxxSignIn") Func xxxxxxxSignIn () __IENavigate($oIE, "https://soa1gui.xxxxxxx.biz/gateway/NFServlet;jsessionid=1E3B8F6520DE0A1EC914A8ABB7E86341?NFH_MessageId=&NFH_Page=%2fpages%2fsearch%2fsearch.jsp", 1, 0x800) Local $domain = _IEGetObjByName ($oIE,"NF_CustomerID") Local $User_Name = _IEGetObjByName ($oIE,"NF_UserName") Local $Password = _IEGetObjByName ($oIE,"NF_Password") _IEFormElementSetValue ($domain, xxxxxxx") _IEFormElementSetValue ($User_Name, "xxxxxxx") _IEFormElementSetValue ($Password, "xxxxxxx") ;Send('{Enter}') EndFunc