Rohini
Rohini

Reputation: 11

How to execute shell script using soapUI

I have one shell script like sample.sh . I want to execute this script using soapUI. How to execute it using soap UI??

Upvotes: 1

Views: 4675

Answers (2)

Payam
Payam

Reputation: 1209

if you want to get results as a string:

Windows:

def result = 'cmd /c sample.bat'.execute().text

Shell:

def result = 'sh -c sample.sh'.execute().text

Please note, the "cmd /c" or "sh -c" part is needed usually to execute a file. If you want to run simple internal commands such as "dir" or "ls", then it won't be necessary.

Upvotes: -1

SiKing
SiKing

Reputation: 10329

You can use Groovy Step to do this. Something like:

p = Runtime.getRuntime().exec("sample.sh")
p.waitFor()

Upvotes: 3

Related Questions