Forum Discussion

amarnath1234's avatar
amarnath1234
Contributor
6 years ago

how to get method and status for the testcases

how to get method and status for the corrosponding test cases . below is my script,when i ran this script for testStepName i got all the list of teststeps for the testcase(Ref:-ss1) but for method ...
  • amarnath1234's avatar
    amarnath1234
    6 years ago

    this is not working,observed below error.

    Error detail

    com.eviware.soapui.support.scripting.ScriptException: Error in TearDown Script of TS1_global offer override Flag_Verification

     

    below  is the code which is working fine-attached SS detail for ref.

    script detail

    def testStepName
    def method
    def statusCode
    def endpointURL
    testCase.testStepList.each{
    testStepName = it.name
    if(testStepName == "Request_GlobalOffersAvailable_Flag") {
    method = it.getHttpRequest().getResponse().getMethod()
    statusCode = it.testRequest.response.responseHeaders["#status#"][0]
    endpointURL = it.getHttpRequest().getResponse().getURL()
    log.info method
    log.info statusCode
    log.info endpointURL
    }
    log.info testStepName
    }
  • TanyaYatskovska's avatar
    TanyaYatskovska
    6 years ago

    Hi Amarnath1234,

     

    Just to clarify - does the last script you posted do what you want?

    If it does, it's worth marking your reply as a solution (just click the Accept as Solution button next to the reply).