Creating a process and/or executing a ruby script internally

S

Steven Garcia

##this is my process create script

puts('hello im run create clicker')
$pid = Process.create(
:app_name => 'ruby clicker.rb',
:creation_flags => Process::DETACHED_PROCESS
).process_id

at_exit{ Process.kill(9,$pid) }


##this is script that is supposed to be the called process

begin
autoit = WIN32OLE.new('AutoItX3.Control')

loop do

autoit.ControlClick("Microsoft Internet Explorer",'', 'OK')
autoit.ControlClick("Windows Internet Explorer",'', 'OK')
autoit.ControlClick("Security Information",'', '&Yes')
autoit.ControlClick("Security Alert",'', '&Yes')
sleep(2)
end

rescue Exception => e
puts e
end




--------------------------------------------------------

In my trek in using WATIR, and building a tough framework for multi-user
tests, I ran across the a couple of javascript alerts. Some researching
has landed me upon this script, that basically creates a daemon of
clicker.rb.

In any case, the problem I'm having has to do with the creating of the
process. A random process is being created in place of where
'clicker.rb' should be.
I've checked the file name of the 'clicker.rb' script, and its as it
should be; and when I run 'clicker.rb' it does its job just as it
should.

The two files are in the same directory as well, I've pretty much got
myself stumped as to why 'clicker.rb' is not being called. Does the
error have to do with the syntax of my name? I tried inputting in the
full file directory path, but maybe I did it wrong.

My requirements are also correct for both files.

Eh...any help would be greatly appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top