jrumbaug Posted December 22, 2014 Posted December 22, 2014 An IE program that I have been using for over a year has started failing. I have traced the problem to this code snipet. The errors happens when I try to get a FORM object from a FRAME object. The message box reports that the $oFrame is an object, but the error says [ Variable must be of type "Object" ] Local $iNumFrames $oFrames = _IEFrameGetCollection ($oIE) $iNumFrames = @extended For $i = 0 to ($iNumFrames - 1) $oFrame = _IEFrameGetCollection ($oIE, $i ) msgBox(1, " var type " & VarGetType( $oFrame) , @error ) $oForms = _IEFormGetCollection ($oFrame) Next The reported errors are: "C:\Program Files\AutoIt3\Include\IE.au3" (903) : ==> Variable must be of type "Object".: Return SetError($_IEStatus_Success, $oTemp.forms.length, $oTemp.forms) Return SetError($_IEStatus_Success, $oTemp^ ERROR ->11:15:29 AutoIt3.exe ended.rc:1 +>11:15:29 AutoIt3Wrapper Finished.. >Exit code: 1 Time: 17.812 Thank you in advance for suggestions. Jim Rumbaugh
MikahS Posted December 22, 2014 Posted December 22, 2014 (edited) maybe instead of $oTemp.forms.length try $oTemp.frames.length As you said it yourself, its a frame not a form. Edited December 22, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
Danp2 Posted December 22, 2014 Posted December 22, 2014 You are about the 3rd or 4th person to complain about frames no longer working. You may want to review some of the recent threads. I believe someone may have identified an update from MS that is causing this issue. jrumbaug 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
Moderators SmOke_N Posted December 23, 2014 Moderators Posted December 23, 2014 I remember reading that too Dan, do you remember the post or the actual update they removed? Really wish I had that environment to test in. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Danp2 Posted December 23, 2014 Posted December 23, 2014 This >thread is the one where they identified the problematic update. Latest Webdriver UDF Release Webdriver Wiki FAQs
Moderators SmOke_N Posted December 23, 2014 Moderators Posted December 23, 2014 This >thread is the one where they identified the problematic update. Indeed, kb3025390 update seems to be an issue for any and all automation products out there. Thanks Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Solution jrumbaug Posted December 23, 2014 Author Solution Posted December 23, 2014 (edited) Thank you for pointing me to the other thread. My problem was also solved by what I read: "Thanks everyone for extremely helpful responses, the problem is "solved" by uninstalling KB3025390 IE update." The only insight I can add that may help a workaround for use WITH the update: one program worked that began with: $oIE = _IECreateEmbedded () The program that began with this had the errors: $oIE = _IECreate ("http://www.hhcwv.com/") Edited December 23, 2014 by jrumbaug
junkew Posted December 23, 2014 Posted December 23, 2014 (edited) although marked answered.interesting just tried it from Excel VBA to see if there is something not revealed (on my system KB3025390 is installed)Sub test() Dim shW As New SHDocVw.ShellWindows Dim myIE As InternetExplorer Dim myDoc As HTMLDocument Debug.Print shW.Count Set myIE = shW.Item(0) Debug.Print myIE.Name Set myDoc = myIE.document Debug.Print myIE.LocationURL Debug.Print myDoc.frames.Length Debug.Print myDoc.parentWindow.frames.Length Debug.Print myDoc.forms.Length End Sub output1 Internet Explorer http://www.hhcwv.com/ 3 3 0so the frames are returned properly and as vba is telling there are 0 forms its correct you do not get an object maybe rewrite in IE.AU3 (at least you will not get the error as you had); #FUNCTION# ==================================================================================================================== ; Author ........: Dale Hohm ; =============================================================================================================================== Func _IEDocGetObj(ByRef $oObject) If Not IsObj($oObject) Then __IEConsoleWriteError("Error", "_IEDocGetObj", "$_IESTATUS_InvalidDataType") Return SetError($_IESTATUS_InvalidDataType, 1, 0) EndIf ; If __IEIsObjType($oObject, "document") Then Return SetError($_IESTATUS_Success, 0, $oObject) EndIf local $oTemp $oTemp=$oObject.document If __IEIsObjType($oTemp, "document") Then Return SetError($_IESTATUS_Success, 0, $oTemp) Else Return SetError($_IESTATUS_InvalidObjectType, 1, 0) EndIf EndFunc ;==>_IEDocGetObjor write this$oForms = _IEFormGetCollection ($oDoc)but for sure this patch of microsoft gives problems http://stackoverflow.com/questions/27566985/browser-execscript-stopped-working-after-updating-windowsSo far I do not have problems with IUIAutomation framework references and simplespy in examples section running against IE. Edited December 23, 2014 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Moderators SmOke_N Posted December 24, 2014 Moderators Posted December 24, 2014 (edited) execScript was to be deprecated in IE - 11, I made note of this in IEJS.au3. http://msdn.microsoft.com/en-us/library/ie/ms536420%28v=vs.85%29.aspx Edit: Not that anyone would know I made note, I meant to add that I have a work around for it. Edit2: Ok, time for bed, I don't have a work around for KB3025390, my work around is for execScript deprecation. Edited December 24, 2014 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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