Forum Discussion
abhishek813
15 years agoFrequent Contributor
Sorry for the delay Paul, try the below code:
request = context.expand( '${TestRequest#Request}' )
response = context.expand( '${TestRequest#Response}' )
xmlDir = "C:\\temp\\"
//make relevant directory and save request-response XMLs
//request and response XML full path
reqXMLPath = xmlDir + "reqXML.xml"
respXMLPath = xmlDir + "respXML.xml"
def file2 = new PrintWriter (reqXMLPath)
file2.println(request)
file2.flush()
file2.close()
def file = new PrintWriter (respXMLPath)
file.println(response)
file.flush()
file.close()
request = context.expand( '${TestRequest#Request}' )
response = context.expand( '${TestRequest#Response}' )
xmlDir = "C:\\temp\\"
//make relevant directory and save request-response XMLs
//request and response XML full path
reqXMLPath = xmlDir + "reqXML.xml"
respXMLPath = xmlDir + "respXML.xml"
def file2 = new PrintWriter (reqXMLPath)
file2.println(request)
file2.flush()
file2.close()
def file = new PrintWriter (respXMLPath)
file.println(response)
file.flush()
file.close()