Google News
logo
JMeter - Interview Questions
What is assertions in JMeter?
In JMeter, assertions are used to validate the response to a request that you have given to the server. The assertion is the process of comparing the expected and actual results of a request at runtime. If you want to apply assertion to a certain Sampler, make it a child of that Sampler.

By adding "Assertion Listener" to the Thread Group, you can see assertion outcomes. Other listeners will be able to see failed assertions as well.

Some common assertions in JMeter are :

* Response Assertion : Response Assertion is used for combining and comparing pattern strings against one or more server response values.

* Size Assertion : Size Assertion is used to check whether the server response includes the expected number of bytes.

* Duration Assertion : The Duration Assertion is used to check whether or not a server response is received within a defined time limit. If the response takes longer than the specified time, the sample request will be marked as unsuccessful.

* XML Assertion : XML Assertion is used to check whether the server response data contains a valid XML document.

* HTML Assertion : HTML Assertion is used to ensure that the response contains proper HTML syntax and that JTidy is not being used (HTML Syntax Checker). If the HTML syntax response is incorrect, the test will fail.
Advertisement