Yes, you should use #click_no_wait together with Watir Alert API ( http://watirwebdriver.com/javascript-dialogs/)
In your case: require 'watir-classic' b = Watir::Browser.new b.goto 'file:///c:/test.html' b.button(:value => "Press").click_no_wait b.alert.ok Jarmo Pertman ----- IT does really matter - http://itreallymatters.net On Sunday, September 30, 2012 7:27:07 PM UTC+3, enroxorz wrote: > > When I do the following, the Javascript Dialog does not close (in fact, > the button click is stuck and does not go any further). Is there a work > around? > > irb(main):001:0> require 'watir-classic' > irb(main):002:0> b = Watir::Browser.new > irb(main):003:0> b.goto 'file:///c:/test.html' > irb(main):004:0> b.button(:value => "Press").click > > Watir 3.2.0 > Ruby 1.9.3 > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
