jbc1 Posted February 19, 2009 Share Posted February 19, 2009 Hi, I'm have been using AutoIT for some time to automate my applications install. My scripts work OK on ie6, but not on ie7. I have the latest AutoIT version installed, 3.3.0.0. Is IE7 Supported? Thanks, jbc1 Link to comment Share on other sites More sharing options...
exodius Posted February 19, 2009 Share Posted February 19, 2009 In all of the ways I use it, it works just fine... I think you'll want to post an example of what's failing for you. Link to comment Share on other sites More sharing options...
jbc1 Posted February 19, 2009 Author Share Posted February 19, 2009 In all of the ways I use it, it works just fine... I think you'll want to post an example of what's failing for you. Here is the (custom) function I use to wait for controls: expandcollapse popupFunc _MISC_ControlSearchWait($controlName, $windowName, $timeout, $logfile, $iFrameName = "" ) $Previous_Time = TimerInit() While TimerDiff($Previous_Time) < $timeout $Win_hWnd = WinGetHandle($WindowName) If $Win_hWnd = "" Then _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Unable to get handle to " & $WindowName & @CRLF) ;Return 0 Else ;Once we have the handle to the window, we get a handle to the embedded Internet Explorer_Server control $wa = WinActivate($Win_hWnd) $cc = ControlClick ($Win_hWnd, "", "[Class:Internet Explorer_Server]") ;_FileWriteLog($logfile,"_MISC_ControlSearchWait -> " & $WindowName & "activated? $wa="& $wa & @CRLF) ;_FileWriteLog($logfile,"_MISC_ControlSearchWait -> Internet Explorer_Server clicked? $cc="& $cc & @CRLF) $hWnd_IEServer = ControlGetHandle($Win_hWnd,"","[Class:Internet Explorer_Server]") If $hWnd_IEServer = "" Then; _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Error getting handle to the 'Internet Explorer_Server' control" & @CRLF) ;Return 0 Else ;Once we have the handle to the embedded Internet Explorer_Server control, we try to get the object $o_IE = _MISC_ObjGetFromHWND($hWnd_IEServer) If Not IsObj($o_IE) Then;; An error occurred getting the Object from the window handle _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Error getting the 'Internet Explorer_Server' object" & @CRLF) ;Return 0 Else;we got the Internet Explorer_Server object from the handle... If @NUMPARAMS = 4 Then; Look for the control in the current Internet Explorer object ($o_IE) ; Then try to get the requested embedded object $o_Control = _IEGetObjByName($o_IE, $ControlName) If $o_Control <> 0 Then; we got the object _FileWriteLog($logfile,"MESSAGE: _MISC_ControlSearchWait -> Control '" & $controlName & "' found in '" & $windowName & "' window." & @CRLF) Return $o_Control Else _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Control '" & $controlName &"' not found in '" & $windowName & "' window." & @CRLF) ;Return 0 Endif ElseIf @NumParams = 5 Then; Look for the control inside the embedded iframe ; get the iframe object $o_iFrame = _IEFrameGetObjByName($o_IE, $iFrameName) If $o_iFrame <> 0 Then; we got the iframe ; try to get the control within the iframe $o_Control = _IEGetObjByName($o_iFrame, $ControlName) If $o_Control <> 0 Then; _IEGetObjByName got the object within the iFrame _FileWriteLog($logfile,"MESSAGE: _MISC_ControlSearchWait -> Control '" & $controlName & "' found in '" & $iFrameName & "' iFrame." & @CRLF) Return $o_Control Else _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Control '" & $controlName &"' not found in '" & $iFrameName & "' iFrame." & @CRLF) ;Return 0 Endif Else _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> iFrame '" & $iFrameName &"' not found in '" & $windowName & "' window." & @CRLF) ;Return 0 Endif EndIf EndIf EndIf EndIf _FileWriteLog($logfile,"MESSAGE: _MISC_ControlSearchWait -> Retrying in " & $G_MISC_CONTROLCHECK & " msecs..." & @CRLF) Sleep($G_MISC_CONTROLCHECK) WEnd _FileWriteLog($logfile,"ERROR!: _MISC_ControlSearchWait -> " & $timeout &" msecs timeout reached!" & @CRLF) Return 0; Zero represents the control was not found within the specified timeout EndFunc Works just fine on IE6, but not on IE7. Can anybody see any reason why? Link to comment Share on other sites More sharing options...
DaleHohm Posted February 20, 2009 Share Posted February 20, 2009 You'll need to narrow it down more. 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 More sharing options...
PsaltyDS Posted February 20, 2009 Share Posted February 20, 2009 Here is the (custom) function I use to wait for controls: expandcollapse popupFunc _MISC_ControlSearchWait($controlName, $windowName, $timeout, $logfile, $iFrameName = "" ) $Previous_Time = TimerInit() While TimerDiff($Previous_Time) < $timeout $Win_hWnd = WinGetHandle($WindowName) If $Win_hWnd = "" Then _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Unable to get handle to " & $WindowName & @CRLF) ;Return 0 Else ;Once we have the handle to the window, we get a handle to the embedded Internet Explorer_Server control $wa = WinActivate($Win_hWnd) $cc = ControlClick ($Win_hWnd, "", "[Class:Internet Explorer_Server]") ;_FileWriteLog($logfile,"_MISC_ControlSearchWait -> " & $WindowName & "activated? $wa="& $wa & @CRLF) ;_FileWriteLog($logfile,"_MISC_ControlSearchWait -> Internet Explorer_Server clicked? $cc="& $cc & @CRLF) $hWnd_IEServer = ControlGetHandle($Win_hWnd,"","[Class:Internet Explorer_Server]") If $hWnd_IEServer = "" Then; _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Error getting handle to the 'Internet Explorer_Server' control" & @CRLF) ;Return 0 Else ;Once we have the handle to the embedded Internet Explorer_Server control, we try to get the object $o_IE = _MISC_ObjGetFromHWND($hWnd_IEServer) If Not IsObj($o_IE) Then;; An error occurred getting the Object from the window handle _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Error getting the 'Internet Explorer_Server' object" & @CRLF) ;Return 0 Else;we got the Internet Explorer_Server object from the handle... If @NUMPARAMS = 4 Then; Look for the control in the current Internet Explorer object ($o_IE) ; Then try to get the requested embedded object $o_Control = _IEGetObjByName($o_IE, $ControlName) If $o_Control <> 0 Then; we got the object _FileWriteLog($logfile,"MESSAGE: _MISC_ControlSearchWait -> Control '" & $controlName & "' found in '" & $windowName & "' window." & @CRLF) Return $o_Control Else _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Control '" & $controlName &"' not found in '" & $windowName & "' window." & @CRLF) ;Return 0 Endif ElseIf @NumParams = 5 Then; Look for the control inside the embedded iframe ; get the iframe object $o_iFrame = _IEFrameGetObjByName($o_IE, $iFrameName) If $o_iFrame <> 0 Then; we got the iframe ; try to get the control within the iframe $o_Control = _IEGetObjByName($o_iFrame, $ControlName) If $o_Control <> 0 Then; _IEGetObjByName got the object within the iFrame _FileWriteLog($logfile,"MESSAGE: _MISC_ControlSearchWait -> Control '" & $controlName & "' found in '" & $iFrameName & "' iFrame." & @CRLF) Return $o_Control Else _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> Control '" & $controlName &"' not found in '" & $iFrameName & "' iFrame." & @CRLF) ;Return 0 Endif Else _FileWriteLog($logfile, "WARNING: _MISC_ControlSearchWait -> iFrame '" & $iFrameName &"' not found in '" & $windowName & "' window." & @CRLF) ;Return 0 Endif EndIf EndIf EndIf EndIf _FileWriteLog($logfile,"MESSAGE: _MISC_ControlSearchWait -> Retrying in " & $G_MISC_CONTROLCHECK & " msecs..." & @CRLF) Sleep($G_MISC_CONTROLCHECK) WEnd _FileWriteLog($logfile,"ERROR!: _MISC_ControlSearchWait -> " & $timeout &" msecs timeout reached!" & @CRLF) Return 0; Zero represents the control was not found within the specified timeout EndFunc Works just fine on IE6, but not on IE7. Can anybody see any reason why? ...missing a lot of information here: What happens when you run it? What was supposed to happen? What errors come up on the console pane when you run it from SciTE? What does it show in $logfile? 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