Start and Kill the browser using Ruby -
all,
i've got problem need help.
using ruby 1.9.3 in windows, i'm starting browser following command:
system('start http://www.stackoverflow.com') i've tried getting pid of above system cmd in various ways exec, thread , io.popen. everytime different pid assume pid of ruby process.
but need pid of started browser, can kill browser once finish task @ end.
note don't want use watir / selenium or automation tool.
kindly me on this.
don't use start, spawn new window, open browser , detach window. specify browser path explicitly solve problem:
browser = %q{"c:\program files\internet explorer\iexplore.exe"} pipe = io.popen("#{browser} http://www.stackoverflow.com") puts pipe.pid process.kill(9, pipe.pid) run start /? message of start command.
Comments
Post a Comment