All,
I am trying to click a link which will ask a confirmation pop-up with
"OK" and "Cancel" option. I am using the following code and I am not
getting the pop-up while executing the script.
require 'test/unit'
require 'rubygems'
require 'win32ole'
require 'watir'
include Watir
require 'watir/contrib/enabled_popup'
def jsClick( a, button, user_input=nil)
waitTime=30
hwnd = $ie.enabled_popup(waitTime)
if (hwnd)
w = WinClicker.new
if ( user_input )
puts("if = user input")
w.setTextValueForFileNameField(hwnd, "#{user_input}")
end
sleep 3
w.clickWindowsButton_hwnd(hwnd, "#{button}")
w=nil
end
end
$ie=IE.new
$ie.speed= :fast
begin
$ie.link(:text, 'Publish').click_no_wait()
jsClick( $ie, "OK")
puts "Test Passed"
rescue => e
eaData.puts e.to_s
end
but,, am getting the popup if i use $ie.link(:text, 'Publish').click
instead .
I know that i have done a silly mistake. Can anyone please point me
out ?
Thanks
Soori
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
You received this message because you are subscribed to
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]