'JMeter - Getting 400 Bad Request
In JMeter - I am getting 400 bad request.
I have validated the JSON format, JSON request is correct. But showing error in Request body as Error: "Cannot assign " ": "Address.created_by" must be a "User" instance."
In Header manager- I have included all the correct Content-Type and other headers as well.
Could you please provide a solution for this error?
Solution 1:[1]
This is due server side validation failing and server returning 400 - Bad Request. Please check the same request object in Postman or SoapUI
Solution 2:[2]
JSON request might be correct but JSON request body seems to be incorrect, cross check your request body with API specification documentation i.e. Swagger UI it might be the case that API contract has changed and your test is sending the request in the "old" format.
Also Taurus framework has a special tool for converting Swagger API definitions into Taurus YAML files which in their turn can be converted into JMeter .jmx scripts
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rahul Jadhav |
| Solution 2 | Dmitri T |
