Assertion

JMeter – Assertion

Even though performance tests are classified as non-functional tests, getting the correct functional answer is always the main goal. Every performance test tool has a function to check the response from the server before returning a warning or an error if the check is unsuccessful. JMeter also features a unique element called “Assertion” which is used to validate responses against predetermined criteria. The sample passed or failed based on the validation result.

Assertion components essentially belong to the family of post processors because they are executed after receiving the response from the server and then comparing the expected and actual results.

The elements of an assertion have a defined scope. They can have a local or global impact depending on where they are added. The scope of an assertion becomes global, and all requests are validated if you include it as a child in a test plan. On the other hand, the response of that particular sample will only be approved if you add it in a sample.

Possible Parent element(s) of Assertion:

You can add an Assertion under following elements:

  1. Test Plan
  2. Thread Group
  3. Test Fragment
  4. Sampler
  5. Logic Controller
  6. Non-Test Element

List of JMeter’s assertion elements

  1. Response Assertion
  2. Duration Assertion
  3. Size Assertion
  4. XML Assertion
  5. BeanShell Assertion
  6. MD5Hex Assertion
  7. HTML Assertion
  8. XPath Assertion
  9. XPath2 Assertion
  10. XML Schema Assertion
  11. JSR223 Assertion
  12. Compare Assertion
  13. SMIME Assertion
  14. JSON Assertion
  15. JSON JMESPath Assertion
Scroll to Top