-1

I recorded uploading an attachment (pdf file) using blazemeter plugin, then open the jmx file using Jmeter. I modified uploads tab as in the following image and placed pdf file under bin directly. when i run the script i got 400 bad request , could you please advise what might be the issue?

Sample result tab

Request body-1

Request body-2

Request body-3

Request Header

Response body

Response Header

Helio
  • 621
  • 1
  • 4
  • 24

1 Answers1

0

As per 400 Bad Request status code description:

The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing).

So I would recommend using a 3rd-party sniffer tool like Fiddler or Wireshark to capture the requests originating from JMeter and the real browser and compare them.

Requests must be exactly the same (apart from dynamic parameters which need to be correlated), once you amend your JMeter configuration so it will send the same request as the real browser does your file upload will be successful.

We cannot suggest anything meaningful unless we see successful and failing requests dumps fully (URL, headers and body)

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • the only difference between the two requests is that the real request on fiddler we can see the file content while in JMeter we see .. is that the issue ? how can we make the content visible on JMeter request ? – Jumana Haimour Sep 08 '22 at 07:59
  • Don't compare Fiddler with JMeter, compare request from browse in Fiddler with request from JMeter in Fiddler. JMeter hides the content of the files which are being sent with the request, if you want to see the request body in JMeter GUI you need to [increase JMeter's logging verbosity](https://www.blazemeter.com/blog/jmeter-logging) to HTTP components by adding the next line to *log4j2.xml* file `` - then you will see full request and response data in [jmeter.log file](https://jmeter.apache.org/usermanual/get-started.html#logging) – Dmitri T Sep 08 '22 at 08:20