Looks like angularJS
Does the control resemble anything like the controls on
http://angular-file-upload.appspot.com
If yes file_field.set should work.
Sample code:
require "rubygems"
require 'watir'
puts 'start'
$browser = Watir::Browser.new :chrome
$browser.goto("http://angular-file-upload.appspot.com" )
puts $browser.text_field(name: "userName").present?
puts $browser.element(:css => 'input[type=file]').present?
$browser.file_field.set("C:\\848_10.jpeg")
sleep 10
puts 'done'
On Tuesday, October 10, 2017 at 11:14:46 PM UTC-5, Raymond Raymundo wrote:
>
> We just removed the readonly attribute from the html, but file_field
> doesn't since the file upload field has an attribute type='text'. FYI we
> are using angularjs ng-file-upload, so is there anyway to upload a file
> without using file_field?
>
> On Wednesday, October 11, 2017 at 1:10:09 AM UTC+8, Raymond Raymundo wrote:
>>
>> So i'm trying to upload a file to a field that is set to readonly
>>
>> $browser.text_field(id: 'inputResume').set($cv_path.to_s)
>>
>>
>>
>> And I get error
>>
>> Watir::Exception::ObjectReadOnlyException (Watir::Exception::
>> ObjectReadOnlyException)
>>
>>
>> Is there a way around this?
>>
>>
>>
--
--
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/d/optout.