Response Assertion in JMeter example,in this post you will learn how to use Response Assertion in Apache Jmeter with real time examples.In this example you will learn positive and Negative Response Assertion values to verify particular HTTP requests in Apache Jmeter.
1.First Create a Test Plan.
2.Add Thread Group to Test Plan.
3.Enter required details in Thread Group Panel.
7.Now select Response Field to Test is :Text Response , Pattern Matching Rules : Contains
Enter Pattern to Test as Your Specified Text by click on Add button.
8.Before entering pattern text in Response Assertion ,just run your script once in order find specified text for particular http request in view results tree as below.
9.Just find out the text you want to Assert for particular HTTP Request and Enter text in Pattern to Test box.
10.Now run your Test Plan to check HTTP Request response with Response Assertion details.Once your test plan runs as per number thread users then all each and every request details displays in View Results Tree i.e Listners as below.
What is Response Assertion?
Response Assertion in Jmeter verifies HTTP/WSDL or any other requests with specified text response in the form of patterns to Test. Response Assertion gives you http request is pass in case specified given pattern is matched and Fail assertion in case specified pattern to test is not matching with response.Response Assertion in Jmeter example
As per above explanation we will learn Response Assertion with real time examples as below mention details, please read Assertion in Apache JMeter to get Assertions available in Jmeter. We will follow below steps to work with Response Assertion in Jmeter.1.First Create a Test Plan.
Test Plan |
2.Add Thread Group to Test Plan.
3.Enter required details in Thread Group Panel.
5.Record the Script with the help of Recording Controller, please read
How to record script in Jmeter.
6.Add Response Assertion to HTTP Request from ,Right Click on HTTP Samples ->Add ->Assertions ->Response Assertion as below screenshot.7.Now select Response Field to Test is :Text Response , Pattern Matching Rules : Contains
Enter Pattern to Test as Your Specified Text by click on Add button.
8.Before entering pattern text in Response Assertion ,just run your script once in order find specified text for particular http request in view results tree as below.
9.Just find out the text you want to Assert for particular HTTP Request and Enter text in Pattern to Test box.
10.Now run your Test Plan to check HTTP Request response with Response Assertion details.Once your test plan runs as per number thread users then all each and every request details displays in View Results Tree i.e Listners as below.
Response Assertion with VALID text
Response Assertion with INVALID Text
I hope you got good knowledge on Response Assertion in Apache Jmeter with example,Please provide your valuable comments as well as Please share this post.