1

I have a Command Line application which has both Windows (.bat) and Linux (.sh) version. Now I am looking for some testing tool to interactively test it on both OS. Mechanism of the application is similar to Oracle's SQL Plus. After the application is started, it keeps listening to user's enter and gives response accordingly.

I need a tool to work interactively with the Application by providing user enter and retrieving response and verify if the response is expected. Plus, the tool need to be applicable for both Window and Linux.

2 Answers 2

1

This can be done with a variety of tools, all that is necessary is that the test program writes something to the Standad Input of the program under test, and checks the Output.

Examples:

Bash

echo "test input" | my_application | grep "expected output"

Python

completed = subprocess.run(["my_application"], capture_output = True, stdin="test input")
output = completed.stdout
# check that the output is as expected

Similar things are possible for basically all languages that can launch external processes.

0

Linux has the wonderful expect and send pair of programs. Typically used for things like automating dialing to a ISP via modem, where you expect a prompt and then send a reply.

Quick google shows win32 builds of the same tool available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.