Assertions in JMeter

There are various test plan elements in JMeter like thread group controllers, listerns, timers ,assertions, etc. Assertions are used to verify and validate the data of requests that we have sent to the server. Using assertions we can compare the expected result with the actual result. For example, if we want to see a message like the welcome user, then we will add that text in contains column using response assertion. The assertion passes if the given text is present in the response sent by the server or else that request shows an error while executing the test. Here response assertion is one of the assertions that are provided by JMeter.   

Response Assertion 

Response assertions are used to verify the patterns in the response body received from the server. Different pattern matching rules like contains, matches, equal, etc. can be used to verify the response 

Size Assertion 

Size assertion is used to verify the expected number of bytes. We can add the expected size in bytes and verify with the different types of comparisons like >, <, =, etc. 

XML Assertion 

This assertion is used to verify if the XML document provided by the server in response is right or wrong. 

Duration Assertion 

Duration assertion is one of the commonly used assertions in JMeter. Using duration assertion we can verify if the request is being processed within the given amount of time. 

Leave a comment

Your email address will not be published. Required fields are marked *