Looks like it works if you fire the onchange event on the input tag manually
- this code works for me:
(f is the Firefox object)
upload_element = f.element_by_xpath(//inp...@name='field_uploadfile'])
upload_element.set(C:\\foo.txt)
upload_element.fire_event(onchange)
f.span(:text, Upload
Ah, so it's a difference in behavior between FireWatir and Watir?
Not sure why that would happen. Perhaps setting the field with Firefox
doesn't fire the necessary events to enable the upload button? Don't know.
You might try invoking the refresh() method on the Firefox object after you
set
Hi Bill,
My Bad luck ,
After $ff.refresh -- Still the upload video button is not enabled .. :)
Awaiting your reply
Thanks
On Mon, Oct 5, 2009 at 3:04 PM, Bill Agee billa...@gmail.com wrote:
Ah, so it's a difference in behavior between FireWatir and Watir?
Not sure why that would happen.
Hi Bill,
That code sets properly. Its working exactly . But i need alternate way to
do this.
Because The upload button is not enabled automatically after set the p[ath
via like this.
For more details
1. Login youtube.
2. Uninstall Fal;sh player in your machine
3. Goto upload video page.
4.
Hi Bill,
For more details,
The same code working in WATIR:
$ie.file_field(:name, field_uploadfile).set($video_files[0])
$ie.span(:text, 'Upload Video').click
Here i can able to click the Upload Video span . Because it is enabled after
set the file_field path.
But the same code not