user1700502 user1700502 - 2 months ago 12
Bash Question

Run the command on unix system by SoapUI installed on windows machine

I need to execute unix command/shell script on unix system by SoapUI tool.
SoapUI is installed on windows machine.


  1. How to make ssh connection by SoapUI to unix machine?

  2. How to run the command?

  3. How to capture the output of this command?


Answer

You can use the folowing code:

def process = 'ssh user@host myCommand'.execute()
process.waitFor()
println process.in.text
println process.err.text

You can execute it as a testSuite or testCase setUp/tearDown script, script test step or any other place where groovy can be executed.

If that is possible, I recommend to configure the authentication with keys, so that you will not be asked for a password when making a connection.