[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Chetan Patil

9/6/2007 5:50:00 AM

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.
--
Posted via http://www.ruby-....

2 Answers

Kyle Schmitt

9/6/2007 1:52:00 PM

0

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 ;)
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 :)
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(c)
w=nil
end

startClicker("OK")
@link.click



--Kyle

Kyle Schmitt

9/6/2007 2:10:00 PM

0

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

--Kyle