如何使用Groovy将soapui中的请求复制到文件夹? [英] How to copy a request in soapui to a folder using groovy?
本文介绍了如何使用Groovy将soapui中的请求复制到文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Groovy的新手,我希望有一个soap请求,其中包含我要在运行TestCase时复制到具有特定名称的文件夹中的文件.我的测试用例将被创建;首先禁用肥皂请求,然后执行将运行并复制肥皂的常规操作.你能请教吗?
I am new in groovy and I want to have soap request which contains file which I want to be copy to a folder with a specific name when I am running my TestCase. My testcase will be created; first soap request disable and the groovy that will run and copy the soap. Can you please advise?
推荐答案
def cur_Time = Calendar.getInstance(TimeZone.getTimeZone('IST')).format("EEE, dd MMM yyyy HH-mm-ss z")
new File("C:\\Users\\SHILPA\\Desktop\\soapUIxls\\RequestPayload"+cur_Time+".doc").write(context.rawRequest)
这将有助于通过传递的动态值捕获请求有效负载.
It will help to capture request payload with dynamic values passed.
因此您可以在soapUIlog中看到请求和响应负载
So you can see request and response payloads in soapUIlog
log.info(context.response)
log.info(context.rawRequest)
这篇关于如何使用Groovy将soapui中的请求复制到文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文