SoftwareJock Posted June 26, 2011 Share Posted June 26, 2011 After upgrading from Internet Explorer 8 to Internet Explorer 9, my AutoIt script fails on an http (not https) web page in selecting an element from a list & submitting a form. The web page code for the list is: <td width="50%"><b>Source:</b> </td> <td width="50%"><select size="1" name="SourceBox" onchange="javascript:setTimeout('__doPostBack(\'SourceBox\',\'\')', 0)" id="SourceBox"> <option selected="selected" value="">Any Enabled</option> <option value="83bb989f-a591-4d5b-92f9-106320695cb3">S-Video</option> </select></td>The web page code for the submit is:<p align="center"><input type="submit" name="Submit" value="Submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Submit", "", true, "", "", false, false))" id="Submit" /> </p>The related code in my script, which worked under IE 8, is:$oReturn = _IEFormElementSetValue ($oSourceBox, "S-Video")if $oReturn = 0 Then MsgBox(16, "Error", "_IEFormElementOptionselect on $oSourceBox failed") ExitEndIf; Click Submit button.$oSubmitButton = _IEGetObjByName ($oIE, "Submit")if $oSubmitButton = 0 Then MsgBox(16, "Error", "_IEGetObjByName on Submit failed") ExitEndIf$oReturn = _IEAction ($oSubmitButton, "click")if $oReturn = 0 Then MsgBox(16, "Error", "_IEAction on Submit failed") ExitEndIfI modified the code as follows but this code also failed to submit the web page.$oForm = _IEFormGetObjByName($oIE, "Form1")if $oForm = 0 Then MsgBox(16, "Error", "_IEFormGetObjByName on Form1 failed") ExitEndIf$oReturn = _IEFormSubmit($oForm)if $oReturn = 0 Then MsgBox(16, "Error", "_IEFormSubmit on $oForm failed") ExitEndIfThe failure symptoms are that both the element selection action & submit action have no effect; they are essentially ignored. (None of the MsgBox/Exit checks are executing so the _IE functions are returning successful return codes.)I first tried the release version of AutoIt, 3.3.6.1, without success. Now I am using the beta version, 3.3.7.10, & it fails, too.Does anyone have a solution or workaround for this problem? I would be eternally grateful. Thanks. Link to comment Share on other sites More sharing options...
Juvigy Posted June 27, 2011 Share Posted June 27, 2011 Try the IE9 compatibility mode. Also lower the security settings. Link to comment Share on other sites More sharing options...
Tvern Posted June 27, 2011 Share Posted June 27, 2011 Have you tried the _IE error handler already? Link to comment Share on other sites More sharing options...
Zuldan23 Posted August 17, 2011 Share Posted August 17, 2011 (edited) I had the same problem with submitting a form in IE9. It worked great in IE8 but for some reason the _IEFormSubmit function didn't do anything. What I did was turn on the compatibility mode in the registry. If StringLeft(RegRead("HKLM\SOFTWARE\Microsoft\Internet Explorer\Version Vector", "IE"), 1) > 8 Then ;Check for version 9 or later $wshNetwork = ObjCreate("WScript.Network") $struser = $wshNetwork.Username $objWMIService = ObjGet("winmgmts:\\.\root\cimv2") $objAccount = $objWMIService.Get('Win32_UserAccount.Name="' & $struser & '",Domain="' & @ComputerName & '"') RegWrite("HKU\" & $objAccount.SID & "\Software\Microsoft\Internet Explorer\BrowserEmulation\", "AllSitesCompatibilityMode", "REG_DWORD", 1) EndIf After I did this the _IEFormSubmit worked. Hope this helps. Edited August 17, 2011 by Zuldan23 Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 18, 2011 Share Posted August 18, 2011 The was a known issue with ObjName() that caused some IE9 objects to be missed by the IE.au3 UDF functions. An ObjName() change and some tweaks to IE.au3 by DaleHohm are coming. Make sure you've tried it with the latest Beta. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now