Jump to content

IE9 Automation Problems


kevingy
 Share

Recommended Posts

  • Replies 100
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Beta is what it is. Possibly bug free and possibly not. I can tell you that there have been several bugs fixed in the current Beta. Have any new bugs been introduced? Probably; but the devs won't know until someone runs the beta and reports them.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • 3 weeks later...

Hello again guys and gals, :D

I found another issue with IE9 and _IEFormElementOptionselect today...

The example script below fills in only the birth date on the DailyMotion registration form and then submit the form.

In IE9, along with the errors for the other required fields, you get an error for the birthday too: "Your birthdate is required".

In IE8, the errors are only shown for the other fields, and the birthday is fine.

The tests are made with AutoIt 3.3.7.20

#include <IE.au3>
$oIE=_IECreate("http://www.dailymotion.com/register")
$oForm=_IEFormGetObjByName($oIE,"form_register")
$oSelect=_IEFormElementGetObjByName($oForm,"birthdate_month")
_IEFormElementOptionSelect($oSelect, "10", 1, "byText")
$oSelect2=_IEFormElementGetObjByName($oForm,"birthdate_day")
_IEFormElementOptionSelect($oSelect2, "10", 1, "byText")
$oSelect3=_IEFormElementGetObjByName($oForm,"birthdate_year")
_IEFormElementOptionSelect($oSelect3, "1960", 1, "byText")
$oSubmit=_IEFormElementGetObjByName($oForm,"register_submit")
_IEAction($oSubmit,"click")
Link to comment
Share on other sites

Time for a Trac bug report for the latest beta. The following code triggers the event routine showing an onchange event with 3.3.6.1 with IE9 in both IE9 Standards mode and compatability mode, but not with 3.3.7.21 in either mode.

Please enter the report and reply with a cross reference here.

Dale

#include <IE.au3>

$oIE = _IECreate("[url="http://www.dailymotion.com/register"]http://www.dailymotion.com/register[/url]")
 
$oForm = _IEFormGetObjByName($oIE, "form_register")
$oSelect = _IEFormElementGetObjByName($oForm, "birthdate_month")

ObjEvent($oSelect, "EVT_0")

$oSelect.fireEvent("onChange")

Sleep(1000)

Exit

Func EVT_0($s)
 ConsoleWrite("Event: " & $s & @CRLF)
EndFunc

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

Time for a Trac bug report for the latest beta. The following code triggers the event routine showing an onchange event with 3.3.6.1 with IE9 in both IE9 Standards mode and compatability mode, but not with 3.3.7.21 in either mode.

Please enter the report and reply with a cross reference here.

Dale

#include <IE.au3>

$oIE = _IECreate("[url="http://www.dailymotion.com/register"]http://www.dailymotion.com/register[/url]")

$oForm = _IEFormGetObjByName($oIE, "form_register")
$oSelect = _IEFormElementGetObjByName($oForm, "birthdate_month")

ObjEvent($oSelect, "EVT_0")

$oSelect.fireEvent("onChange")

Sleep(1000)

Exit

Func EVT_0($s)
ConsoleWrite("Event: " & $s & @CRLF)
EndFunc

Does it work in any of the other recent betas?
Link to comment
Share on other sites

Ah, you're right. The following code shows that the events are being fired in all cases and that the birthdate validation message appears when in IE9 standards mode, but not in compatability mode.

In this case, I do not know what is different on that page, dv8. It will take digging into the validation routines to see that they are relying upon.

Dale

#include <IE.au3>

$oIE = _IECreate([url="http://www.dailymotion.com/register"]http://www.dailymotion.com/register[/url])

$oForm = _IEFormGetObjByName($oIE, "form_register")
$oSelect1 = _IEFormElementGetObjByName($oForm, "birthdate_month")
$oSelect2=_IEFormElementGetObjByName($oForm,"birthdate_day")
$oSelect3=_IEFormElementGetObjByName($oForm,"birthdate_year")
$oSubmit=_IEFormElementGetObjByName($oForm,"register_submit")

ObjEvent($oSelect1, "EVT_")
ObjEvent($oSelect2, "EVT_")
ObjEvent($oSelect3, "EVT_")
ObjEvent($oSubmit, "EVT_")

_IEFormElementOptionSelect($oSelect1, "10", 1, "byText")
_IEFormElementOptionSelect($oSelect2, "10", 1, "byText")
_IEFormElementOptionSelect($oSelect3, "1960", 1, "byText")
_IEAction($oSubmit,"click")

Sleep(1000)

Exit

Func EVT_onChange()
    Local $o = @COM_EventObj
    ConsoleWrite("Event onChange " & $o.name & @CRLF)
EndFunc

Func EVT_onClick()
    Local $o = @COM_EventObj
    ConsoleWrite("Event onClick " & $o.name & @CRLF)
EndFunc
Edited by DaleHohm

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

Thanks guys! I did some tests with other forms with normal drop-downs and the events are fired OK there with IE9 in normal mode. Apparently DaleHohm is right and this site is using some twisted validation routines, but what bugs me is that my demonstration code works just fine on my other PC with IE8. So it must be something M$ have done with IE9. :D

Link to comment
Share on other sites

Hello again Dale and everyone else,

I run into something else today...

Before the recent COM changes in AutoIt, the following script would loop forever if you close the browser window before it has finished loading the page:

#include <IE.au3>
_IECreate("http://youtube.com")

Now with the latest beta the script crashes with the message: "The requested action with this object has failed." I realize this is the right way to work, but is there any way I can prevent these kind of errors from crashing the script?

Edited by dv8
Link to comment
Share on other sites

Hello again Dale and everyone else,

I run into something else today...

Before the recent COM changes in AutoIt, the following script would loop forever if you close the browser window before it has finished loading the page:

#include <IE.au3>
_IECreate("http://youtube.com")

Now with the latest beta the script crashes with the message: "The requested action with this object has failed." I realize this is the right way to work, but is there any way I can prevent these kind of errors from crashing the script?

Register a com error handler?
Link to comment
Share on other sites

I have an issue with a Gui and a html embedded if the url use the html5 code .

I test on Vista 32bits and IE9!

#include <GUIConstantsEx.au3>
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=ArtOfTouch.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Fileversion=0.1.0.0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <IE.au3>
#include <WindowsConstants.au3>
#include <WindowsConstants.au3>
#include <misc.au3>

_Singleton(@ScriptName)
$WindowsName = "ArtOfTouch"
$url = "https://www.artoftouch.com/en-us/#/create";lecture de la page html
_IEErrorHandlerRegister()
$ie = _IECreateEmbedded()
; Create Reciver window
$hwmd_Reciver = GUICreate($WindowsName, 800, 500, 0, 0);,$WS_OVERLAPPEDWINDOW)
$ieobject = GUICtrlCreateObj($ie, 0, 0, 800, 500)

_IENavigate($ie, $url, 0)
;msgbox(0,"",@error)
GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
Sleep(100)
Wend

Thanks for all help !

Edited by pierrotm777
Link to comment
Share on other sites

  • 2 weeks later...

Most delay seems to be due to the Excel method

$oExcel.Cells($Row, $Column).Comment.Text($str)

in Example Scripts: Show IE objects

My other new Example script

Script line generator for Internet Explorer

that uses no Excel methods, runs smoothly.

Link to comment
Share on other sites

Workaround: replace:

$oExcel.Cells($Row, $Column).Comment.Text($str)

by

$oExcel.Cells($Row, $Column).value = $str

$oExcel.Cells($Row, $Column).Interior.Color = 255 ; Red

and add the comment marker in front of the lines:

; $oExcel.Selection.Comment.Visible = False

; $oExcel.Cells($Row, $Column).AddComment

; $oExcel.Cells($Row, $Column).Comment.Shape.Width = 250

; $oExcel.Cells($Row, $Column).Comment.Shape.Height = 100

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...