我可以在 SOAPUI Groovy 脚本中暂停控制台输入吗?
我在 SoapUI 中有一个 groovy 脚本,它可以访问 Web 服务 - 我希望在附加分析器之前先预热几分钟,所以我让脚本在预热期间运行,然后等我连接分析器后按回车键。有没有办法在 groovy 脚本中要求用户输入?
我尝试了类似的方法,但总是出现 IOException:
log.info "Press return when ready..."
System.in.withReader {
answer = it.readLine() // java.io.IOException: Stream closed
}
感谢您的任何提示。
I've got a groovy script in SoapUI that pokes at a web service - I want things to warm up for a few minutes before I attach a profiler, so I'd the script to run for the warmup period, then wait for me to press return after I've attached the profiler. Is there a way to ask for user input in the groovy script?
I tried something like this, but it always gets an IOException:
log.info "Press return when ready..."
System.in.withReader {
answer = it.readLine() // java.io.IOException: Stream closed
}
Thanks for any tips.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是获取用户数据的最简单方法!
Here is a most easy way to get user data!
让我建议您在模式消息框而不是控制台上暂停。下面是带有消息框的示例代码,该消息框在您关闭它时只是等待:
Let me propose you to pause on modal message box instead of console. Below is sample code with a message box that simply waits while you close it:
只需在提问前写“def”即可
just write "def" before aswer
使用java 6和groovy,你可以做
这是否在soapui脚本中工作是另一回事......:-/
With java 6 and groovy, you can do
Whether this works in a soapui script is another matter... :-/