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:
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