Forum Discussion

amarnath1234's avatar
amarnath1234
Contributor
6 years ago
Solved

html report format issue

hi, I want to generate HTML report for my execution,so for that i designed Setup script and Teardown script which is working fine If my testcase have teststeps only (attached script and report(scre...
  • amarnath1234's avatar
    amarnath1234
    6 years ago

    this is working fine,Thanks for your help.

     

    below is the script.

     

    def testStepName
    def method
    def statusCode
    def endpointURL
    def str
    testCase.testStepList.each{
    testStepName = it.name
    if(it in com.eviware.soapui.impl.support.http.HttpRequestTestStep){
    method = it.getHttpRequest().getResponse().getMethod()
    statusCode = it.testRequest.response.responseHeaders["#status#"][0]
    endpointURL = it.getHttpRequest().getResponse().getURL()
    str = "<tr><td>${testStepName}</td><td>${method}</td><td>${statusCode}</td><td>${endpointURL}</td></tr>"
    file.append(str)
    log.info method
    log.info statusCode
    log.info endpointURL

    }
    }
    file.append("</tbody></table></HTML>")
    file.close()