Title: Message
I think that happens because the autoit WinWait call inside the 'push_security_alert_yes' method doesn't have a timeout value.  So it waits forever, looking for the "Security Alert" window.  You can check out the details of how that popup is dismissed by looking in your local copy of WindowHelper.rb (which should be in \ruby\lib\ruby\site_ruby\1.8\watir\).
 
A good way to work around this might be to write your own autoit method that copies exactly what 'push_security_alert_yes' does, but with a timeout added.  As a quick test you could try adding this to your "b" thread (after commenting out the WindowHelper stuff in the thread):
 
require 'win32ole'
autoit = WIN32OLE.new('AutoItX3.Control')
autoit.WinWait "Security Alert", "", 5
autoit.Send "{TAB}"
autoit.Send "{TAB}"
autoit.Send "{SPACE}"
 
I think that should work (I didn't test it, though).
 
The only major difference between that and 'push_security_alert_yes' is the "5" value added to the end of WinWait.  So I guess if you don't mind editing the library you could make the change (or add a new method) in WindowHelper.rb.  But in the long term, the change might get lost in an upgrade or something, so...
 
Docs on WinWait and many more useful autoit functions are in AutoItX.chm (or http://www.autoitscript.com/autoit3/docs/functions.htm).
 
Thanks
Bill
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Passmore
Sent: Tuesday, January 17, 2006 3:58 PM
To: [email protected]
Subject: [Wtr-general] threads to close security - working unless it doesn'tcome up.

I am testing stuff on two different servers.  on one server I get a security alert which I am taking care of with this:
a = thread.new {
 code here...
}

b = Thread.new {
  sleep 1;
  helper = WindowHelper.new;
  helper.push_security_alert_yes;
}

If the security alert doesn't pop up as is true on the second server, the code in A just sits there like it is waiting for b to finish up and join it. 

Please help.

Thanks.

Jon
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to