I'm having problems with the win32/process Process.create() method. The following link is very useful...
http://textsnippets.com/posts/show/829 The issue, I think, is with finding the file to launch with the Process.create() method. [jclicker.rb] require "watir" # Auto Popup Handler. Posted by [EMAIL PROTECTED] # require 'win32ole' # already included if you use 'require watir' begin autoit = WIN32OLE.new('AutoItX3.Control') loop do autoit.ControlClick("Microsoft Internet Explorer",'', 'OK') autoit.ControlClick("Security Information",'', '&Yes') autoit.ControlClick("Security Alert",'', '&Yes') sleep(5) end rescue Exception => e puts e end If I run this script directly 'ruby jclicker.rb', then any javascript popup windows will "magically" click away. It works really cool! However, if I use the win32/process library to create a process while running a test, then the popup handler doesn't run. [runtest.rb] require 'win32/process' $pid = Process.create( :app_name => 'ruby jclicker.rb', :creation_flags => Process::DETACHED_PROCESS ).process_id at_exit{ Process.kill(9,$pid) } class TC_NewTest < Test::Unit::TestCase ... end It's as if the process is not getting created. The jclicker.rb script is in the same directory as the test program. But, the clicker doesn't run. Any hints are greatly appreciated. _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
