Accept Status Code 400 as Success
How to access Response Status Code 400 as Success? My sampler failed, because the server returns the 400 status code.
You can follow this tutorial to access Response Status Code 400 as Success by adding/modifying the Response Assertion.
If you are intentionally testing a REST API that returns an expected 400 response code, you need to add or modify the Response Assertion of the sampler to have "Ignore Status" check box checked:
[x] Ignore Status
For example, if you want to assert that the response code is 400, you can create Response Assertion with:
Field to Test: Response Code [x] Ignore Status Pattern Matching Rules: Equals Patterns to Test: 400
Or if you want to assert that the response body contains the word "Error" with any response code, you can create Response Assertion with:
Field to Test: Text Response [x] Ignore Status Pattern Matching Rules: Matches Patterns to Test: .*Error.*
2018-02-01, 225👍, 0💬
How to generate IP Addresses? To help you to obtain some IP addresses for testing purpose, FYIcenter...
How to validate domain name format? In order to help your programming or testing tasks, FYIcenter.co...
How to generate test credit card numbers? Test credit card numbers are frequently needed in testing ...
How to generate email addresses? To help you to obtain some email addresses for testing purpose, FYI...
How to perform regular expression Search and Replace? To perform a regular expression pattern Search...