From: Pranjal Jain Date: 2008-05-23T14:07:05+09:00 Subject: Re: Unable to run(automate) different file via Ruby HI Gordon Thankx it worked. But now I am facing a new problem, when I want to run tht script , I cant do it. the script is as follows : # This script can drive any scripts return anywhere on system # WinClicker Library of Watir module required require 'watir/winClicker' require 'win32ole' wsh = WIN32OLE.new('Wscript.Shell') # path of the script is specified Dir.chdir("d:/Load Runner/gmail") {system("call gmail.usr")} puts "Start" sleep 3 wsh.SendKeys('%u') wsh.SendKeys('R') # Wait for 2 seconds sleep 2 puts "end" Thankx in advance :) Gordon Thiesfeld wrote: > On Thu, May 22, 2008 at 4:28 AM, Pranjal Jain > wrote: >> # WinClicker Library of Watir module required >> require 'watir/winClicker' >> >> # path of the script is specified >> Dir.chdir("d:/Load Runner/gmail") {system("gmail.usr")} > > Kernel.system doesn't know how to handle these files. You'd get the > same thing if you tried to run a ruby file: > > # test .rb > puts 'hello world' > > # irb session >>> system('test.rb') > => false >>> system('ruby test.rb') > hello world > => true >>> system('call test.rb') > hello world > => true > > So, either write the command so that it calls the executable that runs > your .usr file, or use 'call'. > > Hope that helps, > > Gordon -- Posted via http://www.ruby-forum.com/.