Estevao FPM
Estevao FPM

Reputation: 111

File isn't sent after successful upload - Jmeter

I'm with the following problem: I'm using the tool Jmeter for automated testing.

One of the services is to send a file, using the method PUT in the URL. I correctly place the call. The status HTTP is 200! However, when i verify the next endpoint, a GET this URL with the file, the image is not in it.

I've done the same test in Postman. It sent the file successfully!!

Why this?? Could anyone help?

Follow below the test:

PUT https://s3.amazonaws.com/cl-dev-identity-xxxxx.... 

In Sampler HTTP Requests > Files Upload:

    File Path: C:\Users\me\testing.png;
    Parameter name: I added a any parameter name, in this case, "upload";
    MIME Type: image/png

Selected

Use KeepAlive

Use multipart/form-data

I await you!!! Thank you!

Upvotes: 0

Views: 896

Answers (1)

Dmitri T
Dmitri T

Reputation: 168217

If request works in Postman but doesn't work in JMeter - you're not sending the same request, you're sending different requests.

It is impossible to tell what's wrong without seeing your full Postman and JMeter requests configurations so I can give you only generic piece of advice: just record the request from Postman using JMeter's HTTP(S) Test Script Recorder

  1. Start HTTP(S) Test Script Recorder

  2. Configure Postman to use JMeter as the proxy

    enter image description here

  3. Copy the file you're going to upload to the "bin" folder of your JMeter installation. This step is essential, otherwise JMeter won't be able to properly capture the request. see Recording File Uploads with JMeter article for more details

  4. Execute the request in Postman

  5. JMeter will capture the request and generate the relevant HTTP Request sampler and HTTP Header Manager

Upvotes: 1

Related Questions