Collections:
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.
✍: FYIcenter.com
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.*
⇒ Recording with JMeter HTTP Proxy
⇐ JSON Extractor - Capture JSON Data
2018-02-01, 9739🔥, 0💬
Popular Posts:
How to generate user full names? Test user names are frequently needed in testing applications that ...
How to perform regular expression pattern match with multiple occurrences? To perform a regular expr...
What are JMeter command line options? You can get see JMeter command line options by running this co...
How to generate date and time test values? Timestamp values are frequently needed in testing almost ...
How to convert a date and time to a standard format? Date and time can be displayed in a number of s...