dialog button doesn't work

M

mirth

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top