From: mirth Date: 2008-02-28T00:09:55+09:00 Subject: dialog button doesn't work Hi guys, I'm using watir to do some tests. During the test, an alert window will pop up. When it pops up, I will click the "OK" button on the dialog so that the test will continue. So I have below code to check the dialog exists and click the OK button: if dialog.exists? puts "found the popups" dialog.button('OK').click puts "suppose to kill the popups" end For some unknown reasons, sometimes, the same alert window will disppear after clicking OK button sometimes the click doesn't seem to work. But the two print statements always work. Then I tried to use autoit = WIN32OLE.new('AutoItX3.Control') if dialog.exists? puts "found role pop ups " autoit.Send('{enter}') puts "suppose to kill the popups" end The same happens. Two print statements always work but the alert window sometimes doesn't go away. Could anyone tell me if I've done something wrong? I just can't figure out so any help is appreciated. Thanks!