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, 11🔥, 0💬
Popular Posts:
Where to find test data generators? FYIcenter.com has prepared a number of test data generators for ...
How to convert hexadecimal encoded data back to binary data (or Hex to Binary Decoding)? Hex to Bina...
How to find out my browser request headers? To help you to see your browser request headers, FYIcent...
How to set Content-Type to application/json? The server requires the Content-Type to be application/...
How to Override a JMeter Variable from Command Line? I want to run the same test plan multiple times...