arpan Posted April 28, 2011 Share Posted April 28, 2011 (edited) Hi Folks, I have written a script for file download for IE. It works fine if the focus is on the download box. So explicitly I am trying to get the focus on the download window Sometimes it works , sometimes doesn't. Earlier I tried doing by using the window names directly but it was not working so i have tried using windows but same results One more scenario is : click on the download link in IE page, see the dialog box, open instance of chrome or opera browser. And run the script it fails. I am not sure why its happening. Can any one tell what went wrong? _Any help will be fine _ I am attaching the script example here: expandcollapse popupAutoItSetOption("WinTitleMatchMode","2") ; ; wait Until dialog box appears and timemout of 10 seconds. $wait = WinWait("Download","",30) $title = WinGetTitle("Download") $handle = WinGetHandle($title) WinActivate($handle) If $wait =0 Then Exit EndIf If (StringCompare($CmdLine[2],"Save",0) = 0) Then $wait = WinWaitActive($handle,"",10) If $wait =0 Then Exit EndIf ControlClick($handle,"","Button2") $wait = WinWait("Save","",5) If $wait =0 Then Exit EndIf $title = WinGetTitle("Save") $handle = WinGetHandle($title) if($CmdLine[0] = 2) Then $wait = WinWaitActive($handle,"",5) If $wait =0 Then Exit EndIf ControlClick($handle,"","Button2") Else ;Set path and save file $wait = WinWaitActive($handle,"",10) If $wait =0 Then Exit EndIf ControlSetText($handle,"","Edit1",$CmdLine[3]) ControlClick($handle,"","Button2") Exit EndIf EndIf Edited April 28, 2011 by arpan Link to comment Share on other sites More sharing options...
wakillon Posted April 28, 2011 Share Posted April 28, 2011 Did you try to get the url of download link, to use with inetget ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
arpan Posted April 29, 2011 Author Share Posted April 29, 2011 (edited) Did you try to get the url of download link, to use with inetget ?@Wakillon. Thanks but we are not supposed to give or know the URL of the download location. We need to simulate the user behaviour. And wait for the popup to come and click. Again some times we want to read the text of the dialog window (content on the dialog box)I found a forum discussion on the same. Looks like its a limitation with RDP. Here is the link: Edited April 29, 2011 by arpan 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