From: Dave Wilson Date: 2008-11-04T22:50:41+09:00 Subject: Re: Ruby Threads in Windows OK thanks, I have solved the issue. The original problem is to do with watir popup handling. My work has written a massive (and bloated) testing framework around watir to test a highly varient application. I am currently reworking this framework to try and clean it up a but. The recommended approach for handling popups in Watir does not seem to work on our machines (none of the unit tests wupplied with watir work) and I currently cant upgrade them, so the original test framework handled them by running ruby code in a new process which ran in the background and waited for the popups. The approach was 1) Launch new popup thread 2) Fire event that caused popup In some cases we dont get popups (environment logins etc) so the rubyw processes would remain until a new test would launch another popup thread and then we would ahve 2 threads attempting to login at the same time. I hasten to add I did NOT design the original framework and I dont like this brute force approach to popups. So taking your advice I have taken a new approach which is to wrap the event that (potentially) causes the popup in a timeout, and the recover to that timeout is a popup handler which runs in the same thread. If the popup does not apprear, the method does not time out so the popup handler is not created. Its not a great solution but will do until the framework is updated to the latest version of watir and ruby. And hopefully a newer OS. Thanks for your help. -- Posted via http://www.ruby-forum.com/.