I ran this locally and it worked for me.

 

require 'watir'

require 'watir\contrib\enabled_popup'

 

include Watir

 

def startClicker( button , waitTime=9, user_input=nil)

  hwnd = $ie.enabled_popup(waitTime)  # get a handle if one exists 

  if (hwnd)  # yes there is a popup

    w = WinClicker.new

    if ( user_input )

      w.setTextValueForFileNameField(hwnd, "#{user_input}")

    end

    sleep 3  # I put this in to see the text being input it is not
necessary to work

    w.clickWindowsButton_hwnd(hwnd, "#{button}")  # "OK" or whatever the
name on the button is

    w=nil    # this is just cleanup

  end

end

 

$ie = IE.new()

 

$ie.goto("C:\\fileupload.html")

$ie.fileField(:name, "fileone").click_no_wait

 

fPath = "file://C:\\mytext.txt"

 

startClicker("&Open", 7, fPath ) # 3rd parameter is optional.

 

Hope this helps,

 

--Mark

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Richard Oei
Sent: Wednesday, December 13, 2006 6:16 PM
To: [email protected]
Subject: Re: [Wtr-general] Issue WTR-108 - file_field.set not working

 

I've attached all the applicable files. The easiest way to do this is to
simply download all three files to the root of drive C and then execute
testme.rb. The script works flawlessly with Watir 1.5.1.1081 however
does not work at all with 1.5.1.1127.

 

Richard

 

 

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to