[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Javascript Alerts with Watir

DaFallus

6/30/2006 8:35:00 PM

I was able to get Watir to handle most JavaScript alert windows using
the following method:

require 'watir'
def startClicker( button , waitTime = 3)
w = WinClicker.new
c = "start rubyw c:\\Watir\\clickJSDialog.rb #{button} #{waitTime}"
w.winsystem(c)
w=nil
end

The only problem I'm experiencing now is that when I have Watir click
through about 16 different buttons that all cause JavaScript alert
windows to pop-up it will not click through one or two of the alert
windows.

Instead of clicking the OK button on the alert window that pops up it
just changes focus back to the IE window and waits for me to push the
OK button for it.

It is strange because whenever there is a malfunction it is always on
the same buttons. However, sometimes it works and sometimes it doesn't.
Any ideas?

1 Answer

DaFallus

7/7/2006 1:43:00 PM

0

Ok, I restarted my computer today and now for absolutely no reason I
cannot get Watir to click through any of the JavaScript alert windows
anymore.