Thanks Roy for the Help...I tried that and it worked but the problem is
it takes a little too long in order to click on ok on the alert box...I
was wondering if there is a way to reduce this waiting time. I reduced
the waitTime in the startClicker function to 0.2 and it didn't change
anything...

Thanks



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Roy Sin
Sent: Monday, December 19, 2005 4:55 PM
To: [email protected]
Subject: Re: [Wtr-general] javascript popup

Hi Tolou,

I spent some time trying out different ways to close javascript popup.
This is what I use and it works great. 
StartClicker method which is from the popups_test.rb sample

#------------
def startClicker( button , waitTime = 0.5)
  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
#-------------
you can either include this def right into your test case or put it in a
seperate rb file and require it and the beginning of your  test. Then
just inlude this one line statement as in
startClicker("OK")
ie.frame("TopToolbar2").link(:id,"a_History").click
just before you launch your popup.

Cheers
Roy


--- Tolou Taherinia <[EMAIL PROTECTED]> wrote:

> 
> Hi all,
> 
> I have an Microsoft internet explorer alert box that comes up when 
> clicking on a button in my web application and Im unable to click on 
> "ok" in order to close this alert message.This is the button that 
> invokes the javascript alert.
> 
> ie.frame("TopToolbar2").link(:id,"a_History").click
> 
> I have tried almost everything...and any help would be greately 
> apprecitaed...
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com _______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general



_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to