// Below code goes in set up script tab
FileWriter file = new FileWriter("C:/Users/amarn/Desktop/ReadyAPI testing script/reporting/Report.html")
def str = '''
WEBSERVICE TEST AUTOMATION REPORT
WEBSERVICE TEST AUTOMATION REPORT
Test Step |
Method |
Status Code |
Endpoint |
'''
file.write(str)
file.close()
// Below code goes in TearDown script tab
FileWriter file = new FileWriter("C:/Users/amarn/Desktop/ReadyAPI testing script/reporting/Report.html")
def testStepName
def method
def statusCode
def endpointURL
def str
testCase.testStepList.each{
testStepName = it.name
method = it.getHttpRequest().getResponse().getMethod()
statusCode = it.testRequest.response.responseHeaders["#status#"][0]
endpointURL = it.getHttpRequest().getResponse().getURL()
str = "${testStepName} | ${method} | ${statusCode} | ${endpointURL} |
"
file.append(str)
}
file.append("
")
file.close()