[Wtr-general] Editing fields in 'Save As' dialog
Alex Ciarlillo
ac251404 at ohio.edu
Sun Dec 3 12:37:23 EST 2006
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
More information about the Wtr-general
mailing list