Modify

Opened 12 years ago

Closed 11 years ago

#2089 closed Bug (Fixed)

_IEFormSubmit gives WEnd^ ERROR

Reported by: ir.r.buitenhuis@… Owned by:
Milestone: Component: Standard UDFs
Version: 3.3.8.0 Severity: None
Keywords: _IEFormSubmit IE9 Cc:

Description

With AutoIt 3.2 and IE8 this works fine. With AutoIt 3.3.8.0 this code gives an error on _IEFormSubmit: AutoIt Error Line 585 (File "C:\program files\autoit3\Include\IE.au3"):
WEnd
WEnd ERROR
Error: The requested action with this object has failed.

#include <IE.au3>
#include <file.au3>
$oIE = _IECreate ("http://www.gmail.com")
$oForms = _IEFormGetCollection ($oIE)
$oForm = _IEFormGetObjByName ($oIE, "gaia_loginform")
$oEmail = _IEFormElementGetObjByName ($oForm, "Email")
_IEFormElementSetValue ($oEmail, "<gmail account>")
$oPasswd = _IEFormElementGetObjByName ($oForm, "Passwd")
_IEFormElementSetValue ($oPasswd, "<password>")
_IEFormSubmit ($oForm)

Attachments (2)

Erreur AutoIt.png (21.6 KB) - added by anonymous 12 years ago.
IE.zip (25.4 KB) - added by anonymous 12 years ago.
Correction for this ticket

Download all attachments as: .zip

Change History (17)

comment:1 follow-up: Changed 12 years ago by Jpm

Just an info Win7 x86/IE9 run OK

comment:2 in reply to: ↑ 1 Changed 12 years ago by krekel

Replying to Jpm:

Just an info Win7 x86/IE9 run OK

Did you provide a valid gmail username/password? The error is only given after a succesfull login.

Changed 12 years ago by anonymous

comment:3 Changed 12 years ago by anonymous

I have the same error with Windows 7 and IE8.
My code is :
; Ouvrir une page Internet Explorer avec l'URL XXXXXXX
$sURL = "XXXXXXXXXXXX"
$oIE = _IECreate($sURL)
; Cliquer sur le lien correspondant pour poursuivre navigation (certificat)
_IELinkClickByText($oIE, "Poursuivre avec ce site Web (non recommandé).")
sleep(1000)
_IELinkClickByText($oIE, "Click here to sign in again")
sleep(1000)
; Saisir les informations de connexion et envoyer le formulaire
$o_form = _IEFormGetObjByName($oIE, "frmLogin")
$o_login = _IEFormElementGetObjByName($o_form, "username")
$o_password = _IEFormElementGetObjByName($o_form, "password")
_IEFormElementSetValue($o_login, "XXXXXXXXXX")
_IEFormElementSetValue($o_password, "XXXXXXXXXXX")
_IEFormSubmit($o_form)
Sleep(1000)

Thank you for your correction

comment:4 follow-up: Changed 12 years ago by trancexx

This is clear bug in IE.au3. It's unbelievable that code can be as dumb and at the same time that no one had reported the issue before.
I'll try to find out who is responsible for the situation.

comment:5 in reply to: ↑ 4 Changed 12 years ago by Zedna

Replying to trancexx:

This is clear bug in IE.au3...
I'll try to find out who is responsible for the situation.

DaleHohm is creator of IE UDF.

comment:6 Changed 12 years ago by Drapdv

Hey guys, for what it's worth, I had a script that ran fine for over a year, then I upgraded to 3.3.8.1 and it started crashing inside a While/WEnd loop. It was bad scripting on my part, but it still shouldn't have caused the error:

While 1

If ...something...
ElseIf ...another thing...
EndIf
ContinueLoop

WEnd

It would hit "ContinueLoop" and say that it must be called inside a loop...

Also, the offending function, _IELoadWait, is exactly the same as it was a year ago, so how would that be causing an error now?

Changed 12 years ago by anonymous

Correction for this ticket

comment:7 Changed 12 years ago by thtioxine@…

Hello,

The problem just _IELoadWait and _IEGetObjectType function
In _IELoadWait, AutoIt Errror is recorded by the instruction _IEInternalRegister (Line 551)
Then, line 560, there is a call at _IEGetObjectType
In this function, we also _IEInternalRegister, but especially in the end we make _IEInternalDeRegister that resets AutoIt Error to its initial value
Result: No functionality to trap COM errors

In Pj : IE.zip (Correction for this ticket)

comment:8 Changed 12 years ago by michael_spellman1985@…

Dear thtioxine@…

I tested with your patch and the result is: There is no error thrown but the problem is that function call _IEFormSubmit() could not return and the program just hang at that line.

comment:9 Changed 12 years ago by anonymous

I tried again with the patch IE.au3 today as follow:

  1. added to my program code "_IELoadWaitTimeout(10000)"
  2. when calling _IEFormSubmit(), program just wait until timeout then it print out the following error:

--> IE.au3 V2.4-0 Error from function _IELoadWait, $_IEStatus_GeneralError (Invalid Error Status - Notify IE.au3 developer)

comment:10 follow-up: Changed 12 years ago by sickm1nd

Woks fine if run .au3 file.
But after compile to .exe? i have "Line 1438 Error: The requested action with this object has failed" each time when i try to run this .exe

comment:11 in reply to: ↑ 10 Changed 12 years ago by sickm1nd

Replying to sickm1nd:

Woks fine if run .au3 file.
But after compile to .exe? i have "Line 1438 Error: The requested action with this object has failed" each time when i try to run this .exe

This problem appears when i try to use obfuscator. Without obfuscator .exe works fine

comment:12 Changed 12 years ago by trancexx

  • Component changed from AutoIt to Standard UDFs

comment:13 Changed 12 years ago by grashopper

When I use the IE.au3 posted here the WEnd error is gone, bust now I get:
--> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType

So this seems not to be the solution.

comment:14 Changed 11 years ago by DaleHohm

This issue is fixed in the 3.3.9.x beta stream. The code has not yet been released in a beta, but is posted here: http://www.autoitscript.com/forum/files/file/227-ieau3/ and can be used with the 3.3.9.x beta versions.

The code takes advantage of the new autoit version changing COM errors to non-fatal and no longer required in internal COM error handler in IE.au3.

There certainly was a logic error in IE.au3 that allowed this to happen, but this code was released and unchanged for years and only recent AutoIt versions/IE versions experience the issue for some reason.

Dale

comment:15 Changed 11 years ago by Jpm

  • Resolution set to Fixed
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.