Jump to content

Problem with IE.AU3. It stopped working


josm
 Share

Recommended Posts

I am new to this product. Some time ago I started to write a small script which can manipulate by one of our web based applications. Everything was ok and I am almost finished when all the sadden it stopped working. It gives me some errors inside of IE.au3 on different functions.

For example this piece of code which was working fine

ConsoleWrite("SubmitLoginForm started" & @CRLF)
if not IsObj($Obj) then ConsoleWrite(" $Obj is not not an object" & @CRLF)
$colForms = _IEFormGetCollection($Obj)
if @error Then ConsoleWrite(" Returned back to my code" & @CRLF )

now give me the error:

SubmitLoginForm started
C:\Program Files (x86)\AutoIt3\Include\IE.au3 (2227) : ==> The requested action with this object has failed.:
Return SetError($_IEStatus_Success, 0, $o_object.document)
Return SetError($_IEStatus_Success, 0, $o_object.document^ ERROR
->12:46:19 AutoIT3.exe ended.rc:1
>Exit code: 1 Time: 7.342

After many experiments and researching the internet I decided to make a very small script to see if problem reappear.

I was very surprised. The same code works for some websites and fails on mine.

Here is my sample code:

#include <IE.au3>

;$URL='http://www.yahoo.com' ; works
;$URL='http://www.google.com' ; works
$URL='http://www.softcomputer.com' ; does not work

$oIE = _IECreate ($URL, 0, 1, 1, 1)
If @error Then ConsoleWrite("Error creating Internet explorer obj." & @CRLF)

It works for YAHOO and GOOGLE . On Softcomputer.com it fails with message:

Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\AutoScripts\Samples\TMS_STUDIO\MyTest.au3"
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
C:\Program Files (x86)\AutoIt3\Include\IE.au3 (560) : ==> The requested action with this object has failed.:
WEnd
WEnd^ ERROR
->13:02:46 AutoIT3.exe ended.rc:1
>Exit code: 1 Time: 2.018

I am completely out of ideas where to look. May be somebody can give a hint.

Link to comment
Share on other sites

  • Moderators

Hi, josm, welcome to the forum. First off, can you please post your entire script? The few lines you have posted are not where the error message is being generated. For example:

this works just fine..

#include <IE.au3>

;$URL='http://www.yahoo.com' ; works
;$URL='http://www.google.com' ; works
$URL='http://www.softcomputer.com' ; does not work
$oIE = _IECreate ($URL, 0, 1, 1, 1)

the error message you're citing...

Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\AutoScripts\Samples\TMS_STUDIO\MyTest.au3"
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
C:\Program Files (x86)\AutoIt3\Include\IE.au3 (560) : ==> The requested action with this object has failed.:
WEnd
WEnd^ ERROR
->13:02:46 AutoIT3.exe ended.rc:1
>Exit code: 1 Time: 2.018

is from a While loop in your code, not from the _IECreate lines above. We need to be able to see the code in its entirety, or else we're just guessing.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I am sorry for missing some information I have to provide at the very first post.

I have IE9, Windows 7 64 bit.

--- To JLogan3o13

Regarding question to post whole script. Sorry I can not publish it because it makes auto login and I do not feel comfortable to publish it. I am doing this for myself but the site is corporate. Any way I feel if I make my little script working the rest will work as well. and there is no any WHILE or other loops on my script. Those few lines are my entire script. I modified it today to print something after _IECretae() to demostrate that it failes inside of IE.au3.

--- To ileandros

I added in my new version of this short script _IELoadWait() even though I am sure the script fails before it reaches this function.

Please look at my new / the same example:

#include <IE.au3>

;$URL='http://www.yahoo.com' ; works
;$URL='http://www.google.com' ; works
$URL = 'http://www.softcomputer.com' ; does not work

$oIE = _IECreate($URL, 0, 1, 1, 1) ; script fails on this operation inside of IE.au3
If @error Then
ConsoleWrite("Error creating Internet explorer obj. ErrCode=" & @error & @CRLF)
Else
ConsoleWrite("Obj created" & @CRLF)
EndIf
_IELoadWait($oIE) ; and never returns back to my code
If @error Then
ConsoleWrite("Error from _IELoadWait($oIE). ErrCode=" & @error & @CRLF)
Else
ConsoleWrite("Obj is ready" & @CRLF)
EndIf

and its output:

>Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\AutoScripts\Samples\TMS_STUDIO\MyTest.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
C:\Program Files (x86)\AutoIt3\Include\IE.au3 (560) : ==> The requested action with this object has failed.:
WEnd
WEnd^ ERROR
->09:43:48 AutoIT3.exe ended.rc:1
>Exit code: 1    Time: 2.028

I have another question. Please look at DOCTYPE. Can XHTML vs HTML on google and YAHOO be the reason?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<!doctype html><html itemscope="itemscope" itemtype="http://schema.org/WebPage">
Link to comment
Share on other sites

Correction. Now I have a small testing page on the same server, and it still failing. So it means problem is not related to XHTML.

<html>


<body>
<p>TEST</p>
</body>

</html>

Can somebody advise how to turn on some diagnostic for IE.au3 to get more details. My script fails right after starting internet explorer somewhere on getting reference to COM object of IE.

Link to comment
Share on other sites

Please show the code that is failing with your test page and the error generated.

Back on your original page, it must be doing something out of the ordinary, like page redirects or something else unexpected.

You may also want to add _IEErrorHandlerRegister() to your code.

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

Link to comment
Share on other sites

Here is my script.

#include <IE.au3>

;_IEErrorHandlerRegister()
;$URL='http://www.yahoo.com' ; works html
;$URL='http://www.google.com' ; works html
$URL = 'http://www.softcomputer.com/index_us.php' ; does not work xhtml
;$URL='http://www.rcmes.com' ; works xhtml

$oIE = _IECreate($URL) ; script fails on this operation inside of IE.au3
If @error Then
ConsoleWrite("Error creating Internet explorer obj. ErrCode=" & @error & @CRLF)
Else
ConsoleWrite("Obj created" & @CRLF)
EndIf
_IELoadWait($oIE) ; and never returns back to my code
If @error Then
ConsoleWrite("Error from _IELoadWait($oIE). ErrCode=" & @error & @CRLF)
Else
ConsoleWrite("Obj is ready" & @CRLF)
EndIf

It starts the IE on proper web page, but does not return back to my script after _IECreate().

This is the output:

>Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\AutoScripts\Samples\TMS_STUDIO\MyTest.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
C:\Program Files (x86)\AutoIt3\Include\IE.au3 (560) : ==> The requested action with this object has failed.:
WEnd
WEnd^ ERROR
->13:09:48 AutoIT3.exe ended.rc:1
>Exit code: 1    Time: 2.120

You can run this script on your PC to check if you get the same errors.

If I am activating _IEErrorHandlerRegister() it hangs and the only way to stop it to press CTRL+Break

Link to comment
Share on other sites

Your code runs and completes without error on my machine. One obvious difference is that I am running 32-bit - don't know what that should matter, but you may want to try running in 32 bit instead of 64. Else, logout or reboot to see if it changes anything.

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

Link to comment
Share on other sites

I ran that code on my system, Win7 x64, and it worked ok. But I'm using IE8 on this computer. I will test it on IE9 when I have access to a computer that has it installed (work computer here and can't install IE9/10 on it).

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Resolved. Not sure that this is the best solution. Probably it is ok as workaround.

I changed User Account Control to lowest "Never Notify" level and everything start working again.

How to do that:

On Windows 7 go to Start menu and type in the search box "User account control". Click on link to the application. You will get "User Account Control Settings" window. Reduce it to minimum level. Everything else except of NEVER NOTIFY does not work.

Link to comment
Share on other sites

Another option which is working is instead of changing of Account control settings, disable on internet explorer protection control.

on IE9.

click Alt and menu will appear on top of the window.

then go to

Tools / Internet options

here you click on second tab, which is Security

now select Internet zone and uncheck the Enable protected mode check box.

Link to comment
Share on other sites

That is not the problem and not a solution. That is the solution on ur device. It runs like a charm on my pc. But i am using ie8 thats why i asked you if ur using ie9. I was having a lot of troubles in _IEcommands while using IE9. I dont know if there is something different in CSS in ie9 but i was having a lot of silly problems without any reasons

Edit: And _IELoadWait() should be placed after _IECreate()

#include <IE.au3>

;$URL='http://www.yahoo.com' ; works
;$URL='http://www.google.com' ; works
$URL = 'http://www.softcomputer.com' ; does not work

$oIE = _IECreate($URL, 0, 1, 1, 1) ; script fails on this operation inside of IE.au3
_IELoadWait($oIE) ; and never returns back to my code
If @error Then
ConsoleWrite("Error creating Internet explorer obj. ErrCode=" & @error & @CRLF)
Else
ConsoleWrite("Obj created" & @CRLF)
EndIf
Edited by ileandros

I feel nothing.It feels great.

Link to comment
Share on other sites

Edit: And _IELoadWait() should be placed after _IECreate()

You don't need the _IELoadWait. _IECreate calls _IENavigate when you call it with a URL, _IENavigate calls _IELoadWait if you don't tell _IECreate to return immediately. So basically _IELoadWait has nothing to wait for.

BTW, I ran the code in post #7 on my home computer with Win7 x64 and IE10 and I never encountered any problems with it, and I have "Enable Protected Mode" turned on.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...