Sign in to follow this  
Followers 0
b0br0ff

Can not find IE's File Download dialog

6 posts in this topic

Autoit fails to find IE's File Download dialog, used code is below:

CODE
#include <IE.au3>

$oIE = _IECreate ("http://qa/TrendNavigate/", 0, 1, 1)

_IELinkClickByText($oIE, "Archives", 0, 1)

_IELinkClickByText($oIE, "Needed file.zip", 0, 1)

WinWaitActive("File Download", "Do you want to open or save this file?");

Send("!s");

_IEQuit ($oIE)

I need to save archive into the certain folder, does somebody know how to simulate "Save target as" for the some link? Or does somebody know why mentioned dialog window can not found? Thank you in advance.

Share this post


Link to post
Share on other sites



I seem to remember having trouble doing this myself. I attributed it to some sort of protection Windows did to try and prevent virus spreading.. but I could be way off. Is InetGet not a viable option?

Share this post


Link to post
Share on other sites

I seem to remember having trouble doing this myself. I attributed it to some sort of protection Windows did to try and prevent virus spreading.. but I could be way off. Is InetGet not a viable option?

Thank You very much!!!!

Share this post


Link to post
Share on other sites

The Inetget works ok for my app too, but it's strange that the File Download dialog acts strangely. It IS visible to AutoIt though, and you can click the Open or the Cancel button. But the Save button just gets focus but doesn't fire. Here's what I've been testing with:

;once dialog has been generated...
WinActivate("File Download")
ControlClick("File Download", "", 4424); the SAVE button gets focus but doesn't fire.
ControlClick("File Download", "", "[CLASS:Button; TEXT:&Save]");same
ControlClick("File Download", "", "[CLASS:Button; INSTANCE:2]");same
;ControlClick("File Download", "", 4423);this DOES fire the OPEN button
;ControlClick("File Download", "", 2); the CANCEL button works as well

Share this post


Link to post
Share on other sites

Try giving the button focus and then sending Enter

Dale


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

Share this post


Link to post
Share on other sites

Try giving the button focus and then sending Enter

Tried Send('{enter}') with no luck. Then I experimented and found that timing was the issue. A sleep(500) before the click works for all buttons!

Thanks!

Share this post


Link to post
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
Sign in to follow this  
Followers 0