Forum Discussion
14 years ago
Hi All,
I am unable to save contents of request & response as XML file when test suite runs on iteration, I tried this code;
def name = testRunner.testCase.name
def location = "E:\\MPI\\Integration\\Paramterization\\Release 15\\"
def getResponseFilename(name) {
date = new Date()
dateFormat = new java.text.SimpleDateFormat('yyyyMMdd-HHmmss')
shortDate = dateFormat.format(date)
respFilename = shortDate + "-" + name + "-response.xml"
}
//Response File//
def Responsefile = new PrintWriter (location + getResponseFilename(name))
def Response = context.expand( '${executeBO - GetJobDetails#Response}' )
Responsefile.println(Response)
Responsefile.flush()
Responsefile.close()
//Request File//
def getRequestFilename(name) {
reqFilename = shortDate + "-" + name + "-request.xml"
}
def Requestfile = new PrintWriter (location + getRequestFilename(name))
def Request = context.expand( '${executeBO - GetJobDetails#Request}' )
Requestfile.println(Request)
Requestfile.flush()
Requestfile.close()
What is happening is its saving empty files in the specified location on each iteration. Any help on this would be of great help.
Regards
I am unable to save contents of request & response as XML file when test suite runs on iteration, I tried this code;
def name = testRunner.testCase.name
def location = "E:\\MPI\\Integration\\Paramterization\\Release 15\\"
def getResponseFilename(name) {
date = new Date()
dateFormat = new java.text.SimpleDateFormat('yyyyMMdd-HHmmss')
shortDate = dateFormat.format(date)
respFilename = shortDate + "-" + name + "-response.xml"
}
//Response File//
def Responsefile = new PrintWriter (location + getResponseFilename(name))
def Response = context.expand( '${executeBO - GetJobDetails#Response}' )
Responsefile.println(Response)
Responsefile.flush()
Responsefile.close()
//Request File//
def getRequestFilename(name) {
reqFilename = shortDate + "-" + name + "-request.xml"
}
def Requestfile = new PrintWriter (location + getRequestFilename(name))
def Request = context.expand( '${executeBO - GetJobDetails#Request}' )
Requestfile.println(Request)
Requestfile.flush()
Requestfile.close()
What is happening is its saving empty files in the specified location on each iteration. Any help on this would be of great help.
Regards
Related Content
- 6 years ago
- 8 years ago
Recent Discussions
- 11 days ago