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

前端 未结 5 814
挽巷
挽巷 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:31

    There is a shorter syntax. Logic is similar what @robert Shared

    def response=context.expand('${TestRequest#RawRequest}')
    new File("c:/testpath/input.xml").write(response)
    

    if you want to reduce it to just one line

     new File("c:/testpath/input.xml").write(context.expand('${TestRequest#RawRequest}')
    

    You can replace RawRequest with whatever you want to save

    Request or Response

    RawRequest is used when you want data replacing the variables used in request

提交回复
热议问题