Store request/response files in local directory with Groovy teststep in soapUI

前端 未结 5 812
挽巷
挽巷 2021-02-09 14:07

Through a groovy teststep in soapUI i want all request and response files to be stored in a local directory with system date.

The groovy teststep in soapUI:



        
5条回答
  •  南方客
    南方客 (楼主)
    2021-02-09 14:26

    There are several ways of doing this. One would be creating a Groovy test step with the following script:

    def myOutFile = "C:/Temp/MyOutDir/response.xml"
    def response = context.expand( '${MyTestRequest#Response}' )
    def f = new File(myOutFile)
    f.write(response, "UTF-8")
    

提交回复
热议问题