tags:

views:

44

answers:

2

I need to build a test bench by sending appropriate inputs to an application. However, once I launch the application, it takes control and does not return to the command prompt (unless an exit command is executed from the application). In that case is there any technique by which I can send a command to that application from the Perl script and interpret the output from that application?

My operating system is Windows.

+1  A: 

If it's a GUI application, take a look at the Win32::GuiTest module. It sends events to GUI applications - simulating user input.

For a command line application, I would normally recommend the Expect module. Unfortunately, Expect doesn't work under Windows.

Robert Wohlfarth
Perl's expect module (a simple clone of the real Expect) doesn't work on windows. But Expect [http://docs.activestate.com/activetcl/8.5/expect4win/welcome.html] itself certainly does. Provided one doesn't mind not programming in Perl.
slebetman
A: 

If there is anyway to write or redirect the application output to a file, you can always open that file to process/interpret the output. If you are talking about a command-line application, it should be easy to redirect the terminal output to a file using the '>' and '>>' characters. It may not be as easy with a GUI app, though.

Daniel Standage