Comparing content value of a file with response JMeter

When working with data related systems, you will have to upload multiple documents as well as download documents and check if the downloaded documents is the same as you expected it to be.

When you call the API call for download and you have the same document in your system or your JMeter package then you can compared the content with the file that you have with you. As always you will have to use the response assertion to compare the file with the response you receive when you download the file from the application (you are testing).

The following call needed to be added in the response assertion of the Download API Call.



You can also a CSV Data config if you will have to compare the response with multiple downloads. Say you know that the download is going to be in order or you would like to make a specific call with a json value and you will need to make the call multiple times then you can use the above call for help.

You can have a CSV file with the names of the files(without extensions) with the respective json you need to to use the following call in the body

Where json_file as the CSV Data config variable.