will watir-1.6.2 support pop-up message

35 views
Skip to first unread message

malar

unread,
Jan 30, 2009, 7:43:17 AM1/30/09
to Watir General
Hi,
i am having Ruby-186.26 and watir-1.6.2 in my system.
will watir-1.6.2 support pop-up message?

require 'watir/IE'
require 'watir/winclicker'
require 'watir/contrib/enabled_popup'

ie.button(:value,"Add").click
hwnd = ie.enabled_popup(10)
if(hwnd)
w = WinClicker.new
w.makeWindowActive(hwnd)
w.clickWindowsButton_hwnd(hwnd, "ok")
end

i tried with this code
But its not working...

Bret Pettichord

unread,
Jan 30, 2009, 10:14:59 AM1/30/09
to watir-...@googlegroups.com
The problem may be with your capitalization. It should be

require 'watir/ie'

If that doesn't help, please give us more information regarding what is
not working.

Bret

infoDrone

unread,
Jan 30, 2009, 11:04:39 PM1/30/09
to Watir General
I think you need to use the click_no_wait method on your button

try
ie.button(:value,"Add").click_no_wait

and see if that helps :)

gem dandy

unread,
Jan 31, 2009, 10:42:18 AM1/31/09
to Watir General
Hello Malar,

Here is an example of what works for me. I've added '.flash' to the
button clicks make it easy follow.
As infoDrone mentioned, click_no_wait must be used on the button that
precedes the popup.
You may need to adjust 'waitTime = 30'. It takes a while for the popup
to appear - just be patient
I'm using the same environment as yours - Ruby-186.26 and
Watir-1.6.2

Can someone comment on why it takes the popup so long to appear?

###################################
require 'watir/ie'
require 'win32ole'
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

test_site = "http://www.google.com"
$ie = Watir::IE.new
$ie.goto test_site
$ie.maximize()
$ie.link(:text, 'Preferences').flash
$ie.link(:text, 'Preferences').click
$ie.radio(:id,"slc").flash
$ie.radio(:id,"slc").set
$ie.button(:name,"submit2").focus
$ie.button(:name,"submit2").flash
$ie.button(:name,"submit2").click_no_wait
jsClick( $ie, "OK")
sleep 5
$ie.close
###################################

Darryl (gem dandy) Brown

malar b

unread,
Feb 1, 2009, 12:33:19 AM2/1/09
to watir-...@googlegroups.com
Hi,
Thank u so much..
i followed ur code,my program is working now
 

malar b

unread,
Feb 1, 2009, 12:34:11 AM2/1/09
to watir-...@googlegroups.com
Hi,
I added this line in my program
it s workin now
thank u
Reply all
Reply to author
Forward
0 new messages