Dashboard > Watir > ... > Pop Ups > File Uploads
Watir Log In View a printable version of the current page.
File Uploads
Added by Zeljko, last edited by Zeljko on Jul 16, 2008  (view change) show comment
Labels: 
(None)

File Uploads

Watir now has a mechanism to support file uploads. Use the file_field method. Run and view the Ruby source in filefield_test.rb in the unit tests folder for usage.

If you are given the option to upload a file from a web page, this is the dialog that will be shown. It would normally appear when using the <input type=file> html tag

See http://msdn2.microsoft.com/en-us/library/ms535263.aspx

Simple example (file image.png should be in the root directory of C: drive):

ie.goto "tinypic.com"
ie.file_field(:id, "the_file").set("C:\\image.png")
Go to contents, previous, next page.

Site running on a free Atlassian Confluence Community License granted to OpenQA. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators