Hi,
Code Used:
$path = "C:/Watir/file.txt"
 $ie.file_field(:name,"srcfile").set($path)
 $autoit = WIN32OLE.new("AutoItX3.Control")
 $autoit.WinWait("Choose file", "Do you want to open or save this file?", 3)
 $autoit.WinActivate("Choose file")
 $autoit.WinWait("Choose file", "Look &in", 3)
 $autoit.ControlSetText("Choose file", "", "Edit1", "#{$path}")
 $autoit.ControlClick("Choose file", "Look &in", "&Open")
 $ie.button(:name, "Open").click
When I run this code the file field highlights(yellow) and the 'Choose File' dialog
opens. But the path is not set in the 'Choose File '  dialog. Along with this there is another file ' setFileDialog.rb '  that opens automatically.
 
The contents of ' setFileDialog.rb '  are as follows:
#
#
# This file contains the file dialog when it runs as a separate process
$LOAD_PATH <&! lt; File.expand_path(File.join(File.dirname(__FILE__), '..'))
puts $LOAD_PATH
require 'watir/winClicker'
filepath = "invalid path passed to setFileDialog.rb"
filepath = ARGV[0] unless ARGV[0]! == nil
clicker= WinClicker.new
clicker.setFileRequesterFileName(filepath)
clicker = nil
 
Thanks
Chaya
 
Send instant messages to your online friends http://in.messenger.yahoo.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
 
Send instant messages to your online friends http://in.messenger.yahoo.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
 
Send instant messages to your online friends http://in.messenger.yahoo.com
_______________________________________________
Wtr-general maili! ng list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Send instant messages to your online friends http://in.messenger.yahoo.com

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

Reply via email to