I was looking at the file uploads section in the Watir wiki Watir File Uploads
The environment which I am using:
- Ruby: 1.8.7
- Watir: 1.8.1
my code looks like this:
ie = Watir::Browser.start("tinypic.com")
ie.file_field(:id, "the_file").set("C:\\image.png")
Now, when the file "image.png" does not exist, it produces a popup as shown below
I tried to use the popup-handlers present in the Javacript popup section on the Wiki, but after debugging, I found out that the set method does not return unless the popup is handled.
What would be a good way to handle it? While searching on Google, I found out somewhere that you could launch a different process in Ruby and try to close the popup window down. If that is the case, can I get some sample code or guidelines as to how to proceed doing the above mentioned thing?
Thanks for any help.