Hue, you have to start the WinClicker BEFORE you click the button that produces the popup.

 

I have a function (right out of the unittests)

 

#Popup clicker

def startClicker( button , waitTime = 3)

  w = WinClicker.new

  longName = $ie.dir.gsub("/" , "\\" )

  shortName = w.getShortFileName(longName)

  c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} "

  puts "Starting #{c}"

  w.winsystem(c)

  w=nil

end

 

#Then I call it...

startClicker ("OK", 3)

 

#Then I click the button that produces the popup.

ie.frame("rightframe").frame("search").button(:name, "Submit").click

 

Hope this helps,

 

--Mark

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hue Mach Dieu
Sent: Monday, July 25, 2005 4:16 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Click OK button on Popup Dialog?

 

Hi All,

My script for click on OK button on popup warning message dialog box,

but it doesn't work

 

ie.frame("rightframe").frame("search").button(:name, "Submit").click

 

w = WinClicker.new

 

w.clickWindowsButton("Microsoft Internet Explorer","OK")

w.clickJavaScriptDialog("OK")

 

Thank for help

 

 

 

_______________________________________________

Wtr-general mailing list

Wtr-general@rubyforge.org

http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to