SOAPUI Groovy 脚本调用命令行
我想运行
ipconfig /all | 之类的命令找到“IPv4”
,它可以获取我连接到的所有接口的 IP 地址。这在纯 Java 或 C# 中是直接的,他们甚至为此提供了托管 API。我可以运行“命令行”命令或访问托管对象来获取我正在寻找的特定接口的 IP 地址。
我有 SOAPUI Pro 并且知道 API 位于此处,但我找不到如何进行命令行调用并获取结果 - 也不是使用该 API 获取 IP 地址的直接方法。
最终我想将运行时 IP 地址存储在项目属性中。
I would like to run something like
ipconfig /all | find "IPv4"
that fetches the IP addresses for all the interfaces I'm connected to. This is straight forward in pure Java or C#, and they even have a managed API for this. I could run a 'command line' command or access managed objects to fetch the IP address of the particular interface I'm looking for.
I have SOAPUI Pro and am aware the API is here, but I cant find out how do either make a command line call and fetch the result- nor a direct way to get the IP addresses with that API.
Ultimately I want to store the runtime IP address in a project property.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此脚本运行 ipconfig /all 命令并将结果获取到变量中。但是获取IP的解析还有待完成。目前,Groovy 步骤将返回整个 ipconfig 结果。
This script runs the ipconfig /all command and gets the result into a variable. But the parsing to get the IP remains to be done. Currently the Groovy step will return the entire ipconfig result.