Thank you Dan, you are the Man!)
Before I did not understand that I should use id of the upload button web
element, I tried to use there system window title.
Now this construction works well and my knowing of Watir methods increased!
Thanks again, have a nice day!
On Tuesday, January 21, 2014 4:46:18 AM UTC+4, Dan wrote:
>
> 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.