if you make you jclicker.rb write a file or something in the loop, then when 
you run it as a process, you should see the extra files get created.

The problem may also be something to do with the stdout and stderr of ruby when 
running as a process.

I tried using the process for a different purpose to you, and gave up. 

console windows may look ugly, but they make it easy to see what the problems 
are...

----- Original Message -----
From: matt <[EMAIL PROTECTED]>
Date: Tuesday, April 3, 2007 2:37 pm
Subject: [Wtr-general] win32/process question

> 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
> 
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to