Forum Discussion

50ReggieTest's avatar
50ReggieTest
Occasional Contributor
9 years ago

Response Size: Why does size() and rawResponseData.length is showing differerent response sizes?

Hi, 

 

I am writing a groovy script that will record the response time of SOAP queries. BUT I am getting different Response sizes between this two lines. I was checking which one of them is accurate. Unfortunately, none of these two is similar to what is shown in the Response Log of my SOAP Response.

 

log.info PropertyName.size()   

 

and

 

responseSize = testRunner.runTestStepByName("PropertyName").rawResponseData.length
log.info responseSize

 

size() is displaying: 51667

rawResponseData.length is displaying: 30716

But the actual Response size from the Response Log is 30588 bytes

 

Kind regards,

2 Replies

  • NishantJadhav's avatar
    NishantJadhav
    Occasional Contributor

    Hi,

     

    Please check this :

     

    Time taken by Request :

    log.info "Time taken" + testRunner.testCase.testSteps["Request 1"].testRequest.response.timeTaken

     

    Size of the reponse content:

    def size = testRunner.testCase.testSteps["Request 1"].testRequest.response.contentLength

     

    Full Response size (in bytes):

    log.info "Full Response size (in bytes) " + testRunner.testCase.testSteps["Request 1"].testRequest.response.rawResponseData.length

     

    The size discrepancy most likely arises due to the way that your operating system saves files to the disk, as well as the way it reports the sizes.

     

    Lemme know if this helps you.

     

    Did my reply answer your question? Give Kudos and Accept it as a Solution to help others, Thanks. ↓↓↓

    • 50ReggieTest's avatar
      50ReggieTest
      Occasional Contributor

      Thanks for the reply.

       

      My tests is about comparing the size of queryResponses of different operations before and after a new deployment/release. If these 2 codes are displaying different information, my tests would be invalid.

       

      Showing the size of the response should not be different whether it is in xml or in plain text format.