From: "Jesús Gabriel y Galán" Date: 2010-07-20T20:29:14+09:00 Subject: Re: click a javascript dialog window in Firefox On Wed, Jul 14, 2010 at 6:39 PM, Mario Ruiz wrote: > Hi, > I'm trying to click a dialog box in Firefox but all the code I found is > not working. > I have watir and firewatir 1.6.5 Firewatir::Firefox has a method startClicker that does that: $ ri startClicker ---------------------------------------- FireWatir::Firefox#startClicker startClicker(button, waitTime = 1, userInput = nil, text = nil) ------------------------------------------------------------------------ Description: Tells FireWatir to click javascript button in case one comes after performing some action on an element. Matches text of pop up with one if supplied as parameter. If text matches clicks the button else stop script execution until pop up is dismissed by manual intervention. Input: button - JavaScript button to be clicked. Values can be OK or Cancel waitTime - Time to wait for pop up to come. Not used just for compatibility with Watir. userInput - Not used just for compatibility with Watir text - Text that should appear on pop up. What this really does underneath is to change the window.alert method for one that returns what you tell it to. It doesn't really open a window anymore. I've used this successfully once. Hope this helps, Jesus.