Earlier nosotros learnt how to purpose answer assertion inwards your jmeter software charge exam to assert answer code of asking inwards my previous post. So at in ane lawsuit you lot already aware close how response assertion works. Here nosotros volition meet representative on how to purpose answer assertion inwards your software charge exam to assert answer message.
Example : Assert Response Message Using Response Assertion
I convey prepared elementary representative on how to assert answer message of asking using answer assertion. If HTTP request has been succeeded in addition to hence nosotros volition become answer message OK.
We volition assert answer message for bellow given ii requests.
- newtours.demoaut.com(Valid URL which returns answer message : OK)
- newtours1.demoaut.com(Invalid URL which returns answer message : Non HTTP answer message)
All other configuration is same equally described inwards my PREVIOUS POST except answer assertion configuration. Configuration of answer assertion for both requests is equally bellow.
- Apply To = Main Sample only.
- Response Field to Test = Response Message.
- Pattern Matching Rules = Contains.
- Pattern To Test = OK.
Note : Both assertions convey same configuration inwards in a higher house software charge exam plan.
Now if you lot run inwards a higher house representative software charge exam plan, Assertion results for both requests volition expect similar bellow.
In lawsuit you lot tin meet that assertion of valid asking is kicking the bucket equally answer message is received "OK" but assertion of invalid asking is failed equally answer message received "Non HTTP response".
This means you lot tin assert answer message of asking using answer assertion inwards software charge exam plan.