Hi folks - I have a problem, can you help?:

I can't successfully click on a button in a File Download dialog window.

First I use WinWait like this:

autoit.WinWait "File Download"

...and it works fine.  It blocks until the file download window
appears.  So far so good.  However, I then want to click on the 'Save'
button on that window, which I try to do like this:

autoit.ControlClick ("File Download", "", "&Save")


...This has the effect of moving the focus of the 'file download'
window to the 'Save' button (though the 'file download' window does
not come to the foreground.  Perhaps when I say "focus" I am using the
wrong terminology, but I think you get the picture.) and the method
call returns "1".  However, the button is not clicked.  I have tried
this from irb and confirmed that if I change the parameters of the
call to ControlClick to something wrong, like: ("File Download
Foo","","&Save") or ("File Download","","&SaveFoo") then the focus is
not changed and the method call returns "0".  So something is
happening when I call ControlClick, but why is there no clicking
happening?  Also, calling ControlClick like this:

autoit.ControlClick ("File Download", "Do you want to open or save
this file?", "&Save")

..does exactly the same thing.

By the way, this problem occurs on one computer, but does not on a
different machine.  On that machine, this stuff works fine.

I need to deploy this little script to several people's computers.  I
am trying to automate a process of logging into a web site and
downloading some files.  Perhaps watir is not the right tool.  On a
side note, I tried using Mechanize, which is a gem based on a Perl
package of the same name, but for some reason it was rejected and
redirected by the server at a certain point in the process.

I also don't understand why the docs indicate that when calling some
autoit functions you can refer to a control or window by title alone,
and sometimes the 'text' of the control is necessary (though that can
apparently still be left blank) and sometimes the "controlID" is
needed.  Using AU3Info.exe I can find controlIDs  but I don't think I
can get them programmatically.

Thanks much!

-Ethan

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to