Forum Discussion

juju44's avatar
juju44
New Contributor
9 years ago

rawResponseData is null in a LoadTest

Hi,

 

I have a TestCase containing a REST Step and Groovy Script Step.

The REST Step return a picture (Content-Type: image/png)

The script needs to get the full response of the first REST step, including headers, as a byte array. (because i'am using a library later)

This is the beginning of the scritp :

 

def image = testRunner.testCase.testSteps['getGrid'].testRequest.response.rawResponseData
log.info(image)

The test suite works fine on a unitary launch.

But when i create a LoadTest the script step fail because image var is null.

 

Is there an other way to get the rawResponseData ?

 

Thanks & Regards

 

  • nmrao's avatar
    nmrao
    Champion Level 3
    Instead of testRunner, would you please try with context (just replace it with testRunner) and see if that helps?
    • juju44's avatar
      juju44
      New Contributor

      Hi Rao,

      I tried your fix, but I still notice the same behavior.

      Thanks & Regards

      • nmrao's avatar
        nmrao
        Champion Level 3
        Just a note, if you see the logs, it clearly says, "Disabling logs during loadtests".

        If you want it, probably, use println statement instead of log.info and see that will help.