| || |
purpose of test - get bad request in the response
i'm trying to test something that i want the response to be code 400 and have a certain string in the text response
I've made the assertion like this
but it still gives an error sign when i run it
even when the result is what i wanted, i want it to have a green color
can anyone help?
Actually you need 2 Response Assertions:
- Response field to test: "Response Code", check "Ignore Status", Pattern Matching Rules: "Equals", Add "400"
- Response field to test: "Text Response", Pattern Matching Rules: "Contains", Add - "your some string"
The key point is "Ignore Status" - it will make any request "green".
Also remember that in "Equals" or "Substring" mode it expects a string and in "Contains" and "Matches" mode you need to provide a Regular Expression, Perl5-style.
See How to Use JMeter Assertions in 3 Easy Steps guide for comprehensive information on using JMeter Assertions.
thank you email@example.com