Search code examples
javajmeterjavabeansperformance-testingbeanshell

How to convert Jmeter Reponse data in to Byte? How to store the Byte value into CSV file?


Our new requirements is there is script A we need to run on two different environment 1 and environment 2.

So we need to convert the response data into on Byte and store into Csv file. Later we need to compare the both byte result from different environment.

But now we need to know how to convert the Response data into Byte and store in byte value in one file?

Any can please help us


Solution

  • Storing response data is not something recommended as it causes high Disk IO overhead. I would suggest modifying your design a little bit, i.e.

    1. Switch to "Advanced" tab of the HTTP Request sampler and tick the box Save repsonse as MD5 hash

      JMeter Save Response as MD5 hash

    2. When you run your test you will see MD5 checksum like 09b9c392dc1f6e914cea287cb6be34b0. The idea is that equal responses will have equal MD5 hashes and storing hashes is a more lightweight process.

    Be aware that you can also use MD5Hex Assertion in order to automatically fail sampler if response isn't equal to expected, check out How to Use JMeter Assertions in Three Easy Steps for details.