For file upload button, there is a ready method, named:
$ie.file_field(:name, "").set("your file.txt")

Wesley.
For life, the easier, the better.


On Tue, Apr 6, 2010 at 12:07 PM, Rats <[email protected]> wrote:

> Firstly, I should have probably mentioned in my previous posts I am a
> Watir newbie. However I have done a fair bit or programming so have
> some knowledge when it comes to using Watir.
>
> Ok, my latest problem is to do with handling a windows file upload
> dialog box. I've done searches through this NG and found that this is
> a fairly common problem. The solutions I've come across suggest use
> of .click_no_wait.
>
> I'm trying to write some code that will click the file upload button,
> enter a file name (full path) in the file name field and then hit
> enter. This is what I tried:
>
> ie.button(:name, "file_upload_button").click_no_wait
> ie.send_keys("c:\test.txt")
> ie.send_keys("{ENTER}")
>
> Unfortunately click_no_wait just flashes the button and the dialog box
> does not pop up. I've tried click by itself and that opens the dialog
> box but of course the rest of the script does not execute.
>
> Any ideas?
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> You received this message because you are subscribed to
> http://groups.google.com/group/watir-general
> To post: [email protected]
>
> To unsubscribe, reply using "remove me" as the subject.
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]

Reply via email to