Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a task and I don't know how to solve it.

We have a Python command line installer, and I should write a functional automated test in JBehave for it.

Does anybody have any idea how to approach this task?

share|improve this question
Have you already defined some tests that you are able to perform manually? Which of them are you trying to automate? Which of them are hard to automate with JBehave? Why? – dzieciou May 10 '14 at 19:45

Although you give limited info about what outcome you need to test and what is holding you back, I still think I can give some pointers.

JBehave is a Java based BDD framework. Use Runtime.getRuntime().exec() to start executables from the command line with Java. See for example usage.

To interact with the command line application you can use Expect. Also have a look at the Java version of Expect which might integrate nicely in the JBehave tests.

Example BDD test scenario:

Scenario: Install application

Given I have our application installer

Copy the installer files some where local. Install Python and other dependencies

When I run the installer

Start the installer (Expect) script with exec()

And answer all the questions it asks

Use Expect to progress the installer

Then it is installed on the local computer

Verify it is installed and the exit code from the installer is correct

And I can start the installed application

Start the application with Expect (if its command line) or start a GUI test of some kind to verify it starts.

More test scenarios:

  • Different configuration options
  • Readonly install directories
  • All possible exit codes
  • Corrupt installer
share|improve this answer
Dear Niels, You are totally right, and sorry about the short description, and thanks for the idea. The command line python script would take arguments, or would act in an "interactive" mode, when quesions are promted for the user, where to install the application(s) by the script. I dont know how to "inject" the params during the script running. It is also a question, how to validate the correct installation (by the Python script) of the 3rd party tools like Oracle DB, ect. And on the top of all that, it would ment to be a multiplatform python installer for linux and win platforms. – attilaapple May 10 '14 at 21:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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