Hi Kogi,

require 'rubygems'
require 'win32ole'

homers_bird(File_Upload_window_Name)

def homers_bird(dialog_name,key="{enter}")
  @ur="C:\\Documents and Settings\\raveendran\\My Documents\\My
Videos\\nike_airport.flv"

  wsh = WIN32OLE.new('WScript.Shell')
  wsh.AppActivate(dialog_name)
  sleep(2)
  wsh.SendKeys("{TAB}")
   sleep(2)
  wsh.SendKeys("{TAB}")
   sleep(2)
  wsh.SendKeys("{TAB}")
   sleep(2)
  wsh.SendKeys("{TAB}")
   sleep(2)
   wsh.SendKeys(@ur)
   sleep(2)
  wsh.SendKeys("{ENTER}")
  sleep(2)
end

#After set the File path Nex tactions ......



I hope the above code will give some idea to you.

Thanks,
P.Raveendran
http://raveendran.wordpress.com


On Tue, Oct 27, 2009 at 6:50 AM, Ethan <notet...@gmail.com> wrote:

> You want to interact with the elements of the 'file upload' dialog? As far
> as I know that thing doesn't have a document or elements that you can access
> like an html page. Or if it doesn't watir doesn't support that anyway. I
> could be wrong - if you figure out how to get a WIN32OLE handle on elements
> of the file upload dialog, I would be very interested in knowing how to do
> that.
>
>
> On Mon, Oct 26, 2009 at 21:14, H Kogi <hko...@gmail.com> wrote:
>
>> Thank you for quick reply.  But I cannot see each object in dialog box as
>> html element.  Is there anyway I can view as html elements?  IE developer
>> toolbar does not work.   I am now trying with WIN32OLE.
>>
>>  On Mon, Oct 26, 2009 at 8:15 PM, Bret Pettichord <b...@pettichord.com>wrote:
>>
>>>
>>> H Kogi wrote:
>>> >
>>> > I may be missing something very simple.  When I get window's File
>>> > Upload dialog, how can I identify file_field's i.e. id, name, index,
>>> > etc?  (index did not work).  I looked in to the the following site and
>>> > all the links from there but not finding answers.
>>> >
>>> > http://wiki.openqa.org/display/WTR/File+Uploads
>>>
>>>
>>> http://wiki.openqa.org/display/WTR/Watir+Methods+Supported+by+HTML+Element
>>>
>>> --
>>> Bret Pettichord
>>> Lead Developer, Watir, www.watir.com
>>> Blog, www.io.com/~wazmo/blog <http://www.io.com/%7Ewazmo/blog>
>>> Twitter, www.twitter.com/bpettichord
>>>
>>>
>>>
>>
>>
>>
>
> >
>


-- 
Regards,
P.Raveendran
http://raveendran.wordpress.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to