[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

dialog button doesn't work

mirthcyy

2/27/2008 3:08:00 PM

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!