Unable to save the JDBC test step request through groovy
Hi All,
I have created a JDBC test step and grrovy script test step to save the jdbc request and response automatically.
I was able to save the jdbc response as per expectation but not the request.
Below script for your reference
def myXmlRequest = "C:/Users/Prabaharans/Desktop/Notification/Database/" + TestCaseID + "_" + "SourceQuery_" + "Request" + ".xml"
def request = context.expand('${JDBCQuery#Request}')
def req = new File(myXmlRequest)
req.write(request, "UTF-8")
def myXmlResponse = "C:/Users/Prabaharans/Desktop/Notification/Database/" + TestCaseID + "_" + "SourceQuery_" + "Response" + ".xml"
def response = context.expand('${JDBCQuery#ResponseAsXml}')
def res = new File(myXmlResponse)
res.write(response, "UTF-8")
An empty file for request is getting created in the mentioned folder.
Appreciate if anyone can help me in resolving this