我可以在SOAPUI groovy脚本中暂停控制台输入吗? [英] Can I pause for console input in a SOAPUI groovy script?

查看:191
本文介绍了我可以在SOAPUI groovy脚本中暂停控制台输入吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SoapUI中使用了一个groovy脚本来访问一个web服务 - 在附加一个分析器之前,我想让事情准备好几分钟,所以我希望脚本能够在预热期间运行,然后等待让我在连接探查器后按回车。有没有办法在groovy脚本中询问用户输入?



我尝试过类似的方式,但总是得到一个IOException:

  log.info准备就绪时按回车
System.in.withReader {
answer = it.readLine()/ / java.io.IOException:Stream closed
}

感谢您的任何提示。让我建议你暂停模态消息框而不是控制台。下面是带有消息框的示例代码,该消息框在您关闭时只是简单地等待:

  def alert = com.eviware.soapui.support .UISupport; 
alert.showInfoMessage(准备就绪后按回车)


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.

解决方案

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 alert = com.eviware.soapui.support.UISupport;
alert.showInfoMessage("Press return when ready...")

这篇关于我可以在SOAPUI groovy脚本中暂停控制台输入吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆