Can you show the html with the file upload field? It'll usually look
something like this.
<input id="file_upload" type="file">
You would then upload a file to it like so.
@browser.file_field(:id, "file_upload").set("C:\\test.txt")
When you do this you won't get any system upload windows, which is expected
and preferable.
On Monday, January 20, 2014 10:52:10 AM UTC-5, FMQO GDRIVE wrote:
>
>
> This construction do not work on Chrome and Firefox too, neither on 7 no
> on XP.
> System upload window is not reachable using method file_field, and I do
> not know why.
> My code
>
> @browser.file_field(:name, "Open").set("\\test.txt")
>
> Error
> Watir::Exception::UnknownObjectException: unable to locate element, using
> {:name=>"Open", :tag_name=>"input", :type=>"file"}
>
> On Monday, January 20, 2014 7:14:48 PM UTC+4, Dan wrote:
>>
>> There's a much easier way to upload a file. Find your file_field element
>> and simply use the file_field method. For example:
>>
>> b.file_field(:id => "my_file").set local_file
>>
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.