0

I am stuck at very critical junction of my scripting in Jmeter, I have a requirement to upload a file on Azure storage and a Microservice which analyze the blob data to process further but it looks for certain size, example 8081920 bytes. I am successfully able to upload the the file of same size on Azure storage but the service returns size Mismatch.

If I upload the same file using Postman, service is able to process the image successfully. Below is the Postman request Header

x-ms-blob-type: BlockBlob Content-Type: image/raw User-Agent: PostmanRuntime/7.26.10 Accept: / Postman-Token: b9384ac9-7fbe-4ab8-834b-aef0d8114588 Host: xxxxxxx.blob.xxxxxx.windows.net Accept-Encoding: gzip, deflate, br Connection: keep-alive Content-Length: 8081920

Jmeter Request Header: Connection: keep-alive Content-Type: image/raw Accept-Encoding: gzip, deflate, br Accept: / x-ms-blob-type: BlockBlob Content-Length: 8082155 Host: xxxxxxx.blob.xxxxxx.windows.net User-Agent: PostmanRuntime/7.26.10

Any idea how to resolve this from where jmeter sending additional 235 Bytes but Postman doesn't.

Thanks, Akshat

Akshat
  • 51
  • 4

1 Answers1

0

Content-Length header is being automatically calculated by both tools as:

sum of request headers (bytes) + request body (bytes)

Given you haven't provided the body we cannot state where the inconsistency lives, from what I can see is that Postman sends Postman-Token and JMeter doesn't so JMeter's Content-Length should be less

In case of multipart file upload the discrepancy can be caused by different boundaries but it shouldn't have any impact on the image processing.

In any case given you're able to successfully upload the file using Postman and cannot do this using JMeter - you can just record the request from Postman using JMeter's HTTP(S) Test Script Recorder - this way you will get confidence that requests are exactly the same. Just make sure to copy the file you're uploading to "bin" folder of your JMeter installation, this way JMeter will be able to properly capture the request.

More information: How to Convert Your Postman API Tests to JMeter for Scaling

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks @Dmitri, I tried recording the using HTTP Test Scripts, but when it comes to upload functionality of AUT application Jmeter is getting hanged, I tried on version 5.1, 5.2 and 5.4, same thing it is getting hanged. I know during recording logs are saved on recording.xml during recording, even that if I import, again tool hungs up. Using Jmeter I am successfully able to upload but a service after upload analyze the size which returns size Mismatch, but the same file name(with same size) works fine on postman. I am totally Clueless what do to, please help – Akshat Mar 24 '21 at 02:05