Modal dialog is not geting closed second time in RUBY:WATIR

model=$browser.modal_dialog
model.close

While closing the forst modal dialog in RUBY : WATIR we used the
following code

model=$browser.modal_dialog
model.close

if we tried to close the same modal dialog second time which is present
in another tab didn’t work.

Pretty watir specific, so maybe repost to the watir mailing list.
The long&short of it is though, modal dialogs are a pain in waitr :wink:
I’ve always had to use winclicker for them.

If you have a link that brings up the dialog, and the link is stored
in the variable @link, something like this should work.

def startClicker( button , waitTime = 3)
#(copied & edited from various sources), I’d cite but I forget all
of them :slight_smile:
w = WinClicker.new
longName = @ie.dir.gsub("/" , “\” )
shortName = w.getShortFileName(longName)
c = "start ruby #{shortName}\watir\clickJSDialog.rb #{button}
#{waitTime} "
puts “Starting #{c}”
w.winsystem©
w=nil
end

startClicker(“OK”)
@link.click

–Kyle

Did I say mailing list? Yeah I did.
Oops, not mailing list, google groups.
http://groups.google.com/group/watir-general/

–Kyle