我有一个保存在远程服务器(linux机器)上的shell脚本,我试图在执行从Windows的SOAPui的各种测试用例之间调用该shell脚本。 所以我准备了一个Groovy脚本:如何从soapui groovy脚本执行shell脚本?
def command="/usr/bin/ssh -p password [email protected]_address bash -s < /home/test.sh"
def proc=command.execute().text
proc.waitFor()
但不幸的是,我收到了一个错误:
产生java.io.IOException:不能运行程序 “的/ usr/bin中/ SSH”:CreateProcess的错误= 2,系统找不到文件指定的错误在行:6
我试图在此搜索更多,但无法获得解决方案。有些链接是:
How to execute shell script using soapUI
http://groovy-lang.org/groovy-dev-kit.html#process-management
如果你执行* SOAPUI *在Windows上不能使用'在/ usr/bin中/ ssh'自'command.execute()'是在本地运行和在Windows中,你没有'/ usr/bin/ssh'。尝试为Windows安装ssh客户端并在您的命令中使用它。 – albciff
我知道我们不能使用/ usr/bin/ssh,但我只需要从windows中的soapui工具执行脚本。那么我怎么能够从ssh客户端执行windows(如腻子等)呢? – Nikhil
我用'putty'看了一下它的示例:) – albciff