[Wtr-general] Editing fields in 'Save As' dialog
Cain, Mark
Mark_Cain at RL.gov
Mon Dec 11 10:45:10 EST 2006
This is pretty obscure but try adding an '&' to 'Save':
clicker.clickWindowsButton('File Download', '&Save')
--Mark
-----Original Message-----
From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alex Ciarlillo
Sent: Sunday, December 03, 2006 9:37 AM
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Editing fields in 'Save As' dialog
Hi,
I am trying to automate the download of a file from a website. I want
the user to be able to set the 'Save in:' and 'File Name:' edit boxes
but I am not sure how to approach this. I have the following code which
gets me as far as the Save As dialog but beyond that I am unsure of what
winClicker methods I need to change these text fields.
#requires
require 'watir'
require 'watir/winClicker'
#includes
include Watir
browser = IE.new
clicker = WinClicker.new
browser.goto( 'http://www.deviantart.com/download/29747336/' )
clicker.clickWindowsButton('File Download', 'Save')
After this I tried adding the following:
h = clicker.getWindowHandle('Save As')
clicker.setTextValueForFileNameField( h , 'test.rar' )
But I got the message 'Unable to obtain handle for filename chooser'
Also I need to change the 'Save In:' field but I'm even less sure how to
approach the combobox.
Any tips or insight on how to accomplish this would be really
appreciated.
Thanks,
-Alex
_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
More information about the Wtr-general
mailing list