You may consider using a thread. Basically in the sample the thread is started. The button is clicked, the popup occurs... the thread def is completed and killed...
See thread: http://groups.google.com/group/watir-general/browse_thread/thread/2d8... for context. Example: def threaded_check_for_popups(sTitleMatch) puts 'threaded_check_for_popups' autoit=WIN32OLE.new('AutoITX3.Control') iReturn=0 iCnt=0 autoit.AutoItSetOption('MouseCoordMode',2) # Relative to client window loop do ret = autoit.WinWait(sTitleMatch,'',1) if ret == 1 then autoit.WinActivate(sTitleMatch) autoit.MouseMove(140,70) # Move over the control autoit.Send('{enter}') # {enter} {Y} {N} {cancel} end sleep 1 autoit.MouseMove(26,26) sleep 3 end puts ' - Return: '+iReturn.to_s return iReturn end #### MAIN ##### myPopup = Thread.new{threaded_check_for_popups(sTitleMatch)} at_exit {Thread.kill(myPopup)} ie.button(:name,'the_button_name').click -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: [email protected] To unsubscribe: [email protected]
