Jmeter Assertion | assertion example - jmeter - jmeter tutorial



What is Jmeter Assertion?

  • Assertion in JMeter is used to validate response of the request, that you have sent to the server.
  • Assertion is a process where you verify expected result with the actual result of the request at run time.
  • If you need to apply assertion on a particular Sampler, then add it as a child of that Sampler.
  • You can view assertion results by adding “Assertion Listener” to the Thread Group.
  • Failed assertions will be displayed in other listeners as well.
  • List of Assertions are as follows:
    • BeanShell Assertion
    • BSF Assertion
    • Compare Assertion
    • Duration Assertion
    • HTML Assertion
    • JSR223 Assertion
    • MD5Hex Assertion
    • Response Assertion
    • Size Assertion
    • SMIME Assertion
    • XML Assertion
    • XML Schema Assertion
    • XPath Assertion
 process of assertion
  • Some common types of Assertions:

1. Response Assertion:

  • Response Assertion can be used to add and compare pattern strings against one or many values of server response.
  • For Example, when you send a request to the URL: https://www.google.com and get the server response.
  • Here, you can verify this response by using Response Assertion.
  • You can insert “Google” as a “Pattern to Test” field value in Response Assertion.
  • If response doesn’t contain this string, it will fail the sampler.
 process of response attertion
  1. Add the pattern string according to your expected response.

2. Size Assertion:

  • Size Assertion is used to verify the server response contains expected number of Bytes or not.
 process of size assertion
  1. Select Response Size Field to Test
  2. Enter expected response size in bytes
  3. Choose type of comparison
jmeter tutorials - jmeter load testing - jmeter download - download jmeter - apache jmeter

3. Duration Assertion:

  • Duration Assertion is used to verify that server response is received within a specified time constraint or not.
  • It will mark the sample request as failed and if response takes longer time duration than the given amount of time.
 process of duartion assertion
  1. Enter duration period of response in milliseconds

4. XML Assertion:

  • XML Assertion is used to verify that the server response data comprises of a correct XML document or not.
 dialogbox of xml assertion

5. HTML Assertion:

  • HTML Assertion is used to verify that the response contains correct HTML syntax or not using JTidy (HTML Syntax Checker). It will fail the test in case of improper HTML syntax response.
 format changes in html assertion

This jmeter tutorial site provides you to the following keypoints on meter interview questions , apache jmeter download , apache jmeter , jmeter load testing , jmeter plugins , jmeter download , download jmeter , jmeter tutorials , load testing jmeter , jmeter summary report , jmeter apache , jmeter api testing , what is jmeter , jmeter load testing example , learn jmeter , how jmeter works , jmeter web service testing , jmeter example , jmeter load testing tutorial , install jmeter , load testing with jmeter , download jmeter for windows , performance testing using jmeter , jmeter functions , mobile app performance testing using jmeter , jmeter gui , install jmeter ubuntu , jmeter stress test , how to use jmeter

Related Searches to Jmeter Assertion | assertion example