Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

IE.au3 WEnd ERROR

IECreate IE.au3

  • Please log in to reply
30 replies to this topic

#1 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 06 February 2012 - 08:45 AM

Each time I run the Autoit script below, I get any of the following 2 error messages:

message 1:

Line 1124 AutoIt3\Include\IE.au3: Local $o_col = $o_object.document.forms.item($s_Name) Local $o_col = $o_object.document^ ERROR Error: The requested action with this object has failed.


message 2:

Line 560 AutoIt3\Include\IE.au3: WEnd WEnd^ ERROR Error: The requested action with this object has failed.


AutoIt Version: 3.3.8.1
Windows 7
IE 8

Autoit script:

#include <IE.au3> $oIE = _IECreate("<a href='http://10.215.144.66/apps/portal/index_login.php' class='bbc_url' title='External link' rel='nofollow external'>http://10.215.144.66/apps/portal/index_login.php"</a>) $oForm = _IEFormGetObjByName($oIE, "form1") $oUser = _IEFormElementGetObjByName($oForm, "user") $oPasswd = _IEFormElementGetObjByName($oForm, "password") $user = "user" $passwd = "password" _IEFormElementSetValue($oUser, $user) _IEFormElementSetValue($oPasswd, $passwd)


LAN web page ("http://10.215.144.66/apps/portal/index_login.php"):

Plain Text         
<html> <body> <table width="100%" border="0" height="90%">   <tr>     <td valign="top" width="120" bgcolor="#CCCCCC" height="100%">       <div align="right">         <form name="form1" id="form1" method="post" action="<a href='https://webapps.domain.org/apps/portal/index.php%22>' class='bbc_url' title='External link' rel='nofollow external'>https://webapps.domain.org/apps/portal/index.php"></a>           <table border="0" bordercolor="#003399" width="100%" cellspacing="0" cellpadding="0">             <tr bgcolor="#003399">               <td colspan="2">                 User               </td>             </tr>             <tr>               <td>                   <br>&#160;User               </td>               <td>                   <br><input type="text" name="user" id="user">               </td>      </tr>      <tr>        <td>                   &#160;Password               </td>               <td>                   <input type="password" name="password" id="password">               </td>                       </tr>      <tr>        <td align="right" colspan="2">    <input type="submit" name="btsubmit" value="Enter">               </td>             </tr>                     </table>           </form>           </div>     </td>   </tr> </table> </body> </html>


Any ideas?

Thanks

Vieri







#2 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,976 posts

Posted 06 February 2012 - 05:17 PM

Add _IEErrorHandlerRegister() to your code and see what messages you receive then.

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


#3 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 16 February 2012 - 08:38 AM

Thanks Dale,

I added the following to the above code example:

Plain Text         
_IEErrorHandlerRegister("MyErrFunc") Func MyErrFunc()     ; Important: the error object variable MUST be named $oIEErrorHandler     Local $ErrorScriptline = $oIEErrorHandler.scriptline     Local $ErrorNumber = $oIEErrorHandler.number     Local $ErrorNumberHex = Hex($oIEErrorHandler.number, 8)     Local $ErrorDescription = StringStripWS($oIEErrorHandler.description, 2)     Local $ErrorWinDescription = StringStripWS($oIEErrorHandler.WinDescription, 2)     Local $ErrorSource = $oIEErrorHandler.Source     Local $ErrorHelpFile = $oIEErrorHandler.HelpFile     Local $ErrorHelpContext = $oIEErrorHandler.HelpContext     Local $ErrorLastDllError = $oIEErrorHandler.LastDllError     Local $ErrorOutput = ""     $ErrorOutput &= "--> COM Error Encountered in " & @ScriptName & @CR     $ErrorOutput &= "----> $ErrorScriptline = " & $ErrorScriptline & @CR     $ErrorOutput &= "----> $ErrorNumberHex = " & $ErrorNumberHex & @CR     $ErrorOutput &= "----> $ErrorNumber = " & $ErrorNumber & @CR     $ErrorOutput &= "----> $ErrorWinDescription = " & $ErrorWinDescription & @CR     $ErrorOutput &= "----> $ErrorDescription = " & $ErrorDescription & @CR     $ErrorOutput &= "----> $ErrorSource = " & $ErrorSource & @CR     $ErrorOutput &= "----> $ErrorHelpFile = " & $ErrorHelpFile & @CR     $ErrorOutput &= "----> $ErrorHelpContext = " & $ErrorHelpContext & @CR     $ErrorOutput &= "----> $ErrorLastDllError = " & $ErrorLastDllError     MsgBox(0, "COM Error", $ErrorOutput)     SetError(1)     Return EndFunc   ;==>MyErrFunc


When I run the script I get the following message, over and over again:

--> COM Error Encountered in script.au3 ----> $ErrorScriptline = 560 ----> $ErrorNumberHex = 800706B5 ----> $ErrorNumber = -2147023179 ----> $ErrorWinDescription = Unknown interface. ----> $ErrorDescription = ----> $ErrorSource = ----> $ErrorHelpFile = ----> $ErrorHelpContext = 0 ----> $ErrorLastDllError = 0


I don't know how to interpret the error message "unknown interface".

Thanks

#4 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,976 posts

Posted 16 February 2012 - 12:41 PM

Well, start by looking at what is at line 560 in your script.

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


#5 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 16 February 2012 - 01:42 PM

There's no such line... My script is the one posted above (just 9 lines of code).
Line 560 probably refers to the included IE.au3 file.

#6 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,976 posts

Posted 16 February 2012 - 07:35 PM

#include <IE.au3> $oIE = _IECreate("[url="http://10.215.144.66/apps/portal/index_login.php"]http://10.215.144.66/apps/portal/index_login.php[/url]")[/font] [font=monospace]_IEErrorHandlerRegister()[/font] [font=monospace]$oForm = _IEFormGetObjByName($oIE, "form1") $oUser = _IEFormElementGetObjByName($oForm, "user") $oPasswd = _IEFormElementGetObjByName($oForm, "password") $user = "user" $passwd = "password" _IEFormElementSetValue($oUser, $user) _IEFormElementSetValue($oPasswd, $passwd)


This is what I had intended you do after my first post. Please run this instead.

There is likely some odd processing going on on that webpage (AJAX updates or page redirects or something). What you will need to do depends on what is happening... dig in and see what you learn.

Dale

Edited by DaleHohm, 16 February 2012 - 07:37 PM.

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


#7 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 17 February 2012 - 10:22 AM

It looks like it has something to do with IE8's security settings.
Since I'm trying to _IECreate an intranet web page, the browser is opened with the setting "Protected mode: disabled".
If I enable "protected mode" for the "local network" then the AuotIT script works as expected...

So I have another problem now: how do I make sure that the IE browser has "protected mode" enabled for the intranet zone before calling _IECreate()?
Or can IE.au3 do that for me?

Better yet, make _IECreate work even if IE8 has "protected mode" disabled.

#8 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 17 February 2012 - 10:47 AM

By the way, I don't know why enabling or disabling "protected mode" should actually make a difference as far as opening a simple web page (no activeX, no nothing), but it does with autoit's IECreate.

#9 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,976 posts

Posted 17 February 2012 - 01:52 PM

It's not easy to wade through, but Microsoft has published extensive information about protected mode and the other security features of IE... you'll need to dig in, I think. Also, please don't ignore my suggestion to run the code above.

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


#10 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 17 February 2012 - 02:05 PM

I actually DID run it (with "protected mode" disabled) and got the following error messages (yes, randomly....):

Line 625 (File "C:Program FilesAutoIt3IncludeIE.au3"); $oTemp = $o_object.document.parentWindow $oTemp = $o_object.document^ ERROR Error: The requested action with this object has failed. ----- same as "message 2" in post 1. ---- Line 549 (File "C:Program FilesAutoIt3IncludeIE.au3"); While Not (String($o_object.readyState) = "complete" Or %o_object.readyState = 4 Or $f_Abort) While Not (String($o_object.readyState) = "complete" Or %o_object.readyState ^ ERROR Error: The requested action with this object has failed.


In other words, 3 different error messages with the same AutoIT code (your code).

If I enable "protected mode", all's fine (no error messages and the script runs fine).

#11 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,976 posts

Posted 17 February 2012 - 02:15 PM

That is pretty obviously not what is written to the console.

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


#12 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 17 February 2012 - 05:45 PM

Why do you say that?
And what "console" are you referring to?
If you want I can post screenshots of the popup windows that actually show these error messages but that won't change anything really. Those are the only messages that AutoIT shows via GUI boxes. Just like in my first post.
As far as the error handler is concerned, I read the AutoIT help file stating that:
"[optional] String variable with the name of a user-defined COM error handler, defaults to the internal COM error handler in this UDF"
However, running your code (exactly as you posted it, but obviously removing the HTML trash this forum has inserted into it) on my machine doesn't show any messages from the "internal COM error handler in the UDF". Instead, it shows popup msgboxes with any one of the 3 messages I posted above.
By the way, just in case you're wondering, I uninstalled a previous AutoIT version before installing the latest.
So I'm pretty sure my IE.au3 is sane.

#13 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,976 posts

Posted 17 February 2012 - 05:49 PM

You're really cheating yourself if you are not running your code from indisde the SciTe editor (F5). It has a console at the bottom that IE.au3 takes full advantage of to display helpful diagnostics.

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


#14 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 17 February 2012 - 06:25 PM

So THAT'S the console you were referring to. OK, will do.
Bear with me please.
I'll try that on Monday from work.
Thanks

Edited by Vieri, 17 February 2012 - 06:29 PM.


#15 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 20 February 2012 - 07:38 AM

As you can see below, I'm not getting more information if I run the code within the editor... Just 3 lines of code.
Am I doing something wrong?
I can send you a screenshot:if you wish.

The code:
#include <IE.au3> $oIE = _IECreate("<a href='http://10.215.144.66/temp/index_login.html' class='bbc_url' title='External link' rel='nofollow external'>http://10.215.144.66/temp/index_login.html"</a>) _IEErrorHandlerRegister()


The console:
>"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "Z:AutoITautologinintranetWin_2K_XPIE6zzz_forum_test2.au3" C:Program FilesAutoIt3IncludeIE.au3 (560) : ==> The requested action with this object has failed.: WEnd WEnd^ ERROR >Exit code: 1    Time: 1.426


#16 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,976 posts

Posted 20 February 2012 - 05:44 PM

Put the call to the error handler BEFORE the line that causes the error...

Dale

Edited by DaleHohm, 20 February 2012 - 05:45 PM.

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


#17 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 21 February 2012 - 02:20 PM

Here's the console message:
>"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "Z:AutoITautologinintranetWin_2K_XPIE6zzz_forum_test2.au3" --> IE.au3 V2.4-0 Error from function _IELoadWait, $_IEStatus_InvalidObjectType >Exit code: 0    Time: 1.027

and here's the source code:
#include <IE.au3> _IEErrorHandlerRegister() $oIE = _IECreate("<a href='http://10.215.144.66/temp/index_login.html' class='bbc_url' title='External link' rel='nofollow external'>http://10.215.144.66/temp/index_login.html"</a>)


#18 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,976 posts

Posted 21 February 2012 - 02:29 PM

There is something unique about the page that you are connecting to. Is it a standard HTML page? A PDF? ActiveX? JAVA? Is it doing a page redirect to a new URL? Are there AJAX client-side updates occuring after load?

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


#19 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 21 February 2012 - 02:45 PM

It's a simple HTML page. Very basic form. No Ajax, nothing. Just need to load the form. In the test source code posted above, I'm not even "post"ing yet.
Here's the HTML source of index_login.html:

Plain Text         
<html> <body> <table width="100%" border="0" height="90%">   <tr>     <td valign="top" width="120" bgcolor="#CCCCCC" height="100%">       <div align="right">         <form name="form1" id="form1" method="post" action="<a href='https://www.hman.local/apps/portal/index.php3%22>' class='bbc_url' title='External link' rel='nofollow external'>https://www.hman.local/apps/portal/index.php3"></a>           <table border="0" bordercolor="#003399" width="100%" cellspacing="0" cellpadding="0">             <tr bgcolor="#003399">               <td colspan="2">                 User               </td>             </tr>             <tr>               <td>                   <br>&#160;User               </td>               <td>                   <br><input type="text" name="user" id="user">               </td>      </tr>      <tr>        <td>                   &#160;Password               </td>               <td>                   <input type="password" name="password" id="password">               </td>                       </tr>      <tr>        <td align="right" colspan="2">    <input type="submit" name="btsubmit" value="Enter">               </td>             </tr>                     </table>           </form>           </div>     </td>   </tr> </table> </body> </html>


#20 Vieri

Vieri

    Seeker

  • Active Members
  • 32 posts

Posted 21 February 2012 - 02:57 PM

It seems to be because in my au3 script I'm calling
http://10.215.144.66/temp/index_login.html
and index_login.html has a "post action" pointing to a hostname
www.hman.local
.

In fact, if I replace www.hman.local with it's IP address, I don't get the error anymore.

But I still don't see why _IECreate should choke on this.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users