From: shiwei zhang Date: 2006-11-21T20:37:39+09:00 Subject: Re: Is there a class that can control the command window ------=_Part_89617_7969879.1164109056562 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline The following api in Ruby provides you a way to run OS cmd in cmd window: exec(command [, arg, ...]); Rgds, On 11/21/06, Olivia Dou wrote: > > I use ruby to do testing. > There are some scenario that look like this: > 1) Do some navigation in the web browser and do some operation in it > 2) run some command, especially telnet to another machine and then run > the commands > 3) operate the browser again > 4) run command in the telnet window again. > > > Now I use watir(Web application Testing in Ruby) to do navigation and > operations in the IE browser, the script look like this: > $ie.goto("http://localhost:8080") > $ie.frame("basefrm").button(:value,"Add Report").click() > > And what I need exactly is a similar ruby lib that I can use to write > the script like this style: > cmdWindow.InputCommand("net user newUser /add") > > I know that I can use NET::Telnet if I want to do telnet related > operations, and when executing the local commands, may use system(cmd), > but I want to identify the specified command window, and run the > following commands in that window. > > I wonder whether I have made the questiong clear. > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_89617_7969879.1164109056562--