1
votes

I am using JMeter 4.0 for recording & running performance tests. I am also fairly new to this tool and for the 1st time, I'm getting Error 400 Bad request for which all the tests are failing. I am recording a website through VPN & trying it to run the test the same way as I did before.

Can you please help me with this. I can provide additional screenshots and details as & when you say required.

Sampler Result:

Thread Name: Converse_Chat_No 1-1 Sample Start: 2018-06-06 14:29:19 IST Load time: 1313 Connect Time: 1104 Latency: 1313 Size in bytes: 1639 Sent bytes:1982 Headers size in bytes: 554 Body size in bytes: 1085 Sample Count: 1 Error Count: 1 Data type ("text"|"bin"|""): text Response code: 400 Response message: Bad Request

Response headers: HTTP/1.1 400 Bad Request Date: Wed, 06 Jun 2018 08:59:22 GMT Content-Type: text/html; charset=utf-8 Content-Length: 1085 Connection: keep-alive Set-Cookie: AWSALB=hCxbUY5Kq+Vdfv1jhO/JGeLqCqRHT281vZy+T4LFgJCRnItYwGILJLnD3KPsv5wYlVGiy85bYqVH75PSlLNCLcPPDTDtgGHoXAKbw9T8QoT6WPxPm6qVI4tyG7H1; Expires=Wed, 13 Jun 2018 08:59:22 GMT; Path=/ Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept Access-Control-Allow-Origin: * Content-Security-Policy: default-src 'self' X-Content-Type-Options: nosniff X-Powered-By: Express

HTTPSampleResult fields: ContentType: text/html; charset=utf-8 DataEncoding: utf-8

1

1 Answers

0
votes

As per 400 Bad Request description:

The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server could not understand the request due to invalid syntax.

The client should not repeat this request without modification.

So most probably you're sending malformed requests which server doesn't understand.

The only troubleshooting technique I can think of is recording requests which real browser sends using a sniffer tool like Fiddler or Wireshark and comparing them to what JMeter sends. The requests should be the same (apart from dynamic data which has to be correlated)

As soon as you amend your JMeter test plan to 100% match requests which are being sent by the real browser it should start working. Don't forget about Cookies and Headers.