JMeter - Size Assertion With Example

Size assertion inward jmeter software charge examine conception is useful to assert the byte size of asking response. You tin operate dissimilar weather condition inward reply assertion like equal to, non equal to, greater than, less than, greater than or equal to, less than or equal to a given release of bytes for response. Here nosotros volition larn how to operate size assertion inward your jmeter software charge examine conception to assert size of response.

Add Size Assertion In Test Plan
Practically nosotros involve to add together size assertion nether request. To add together size assertion nether request,
  • Right click on asking -> Add -> Select Assertions -> Size Assertion. See bellow given image.

It volition add together size assertion nether request.

Example : Using Size Assertion In Jmeter Test Plan
I convey prepared sample jmeter software charge examine event to present y'all how genuinely size assertion works. I convey added ii HTTP requests amongst size assertion equally shown inward bellow image.


Size assertion configuration for both requests is equally bellow.


1st HTTP request's size assertion config

  • Apply To : Main Sample Only
  • Response Size Field To Test : Full Response
  • Size In bytes : 5000
  • Type Of Comparison : >=(Greater than or equal to)

sec HTTP request's size assertion config
  • Apply To : Main Sample Only
  • Response Size Field To Test : Full Response
  • Size In bytes : 5000
  • Type Of Comparison : <=(Less than or equal to)
Only divergence inward both assertion's config is type of comparison.

Both HTTP request's config is same equally bellow.


When y'all run to a higher house examine plan, Result volition looks similar bellow.


In outcome y'all tin encounter that 1st asking is popular off that agency asking reply size is greater than or equal to 5000 bytes which nosotros convey laid inward 1st request's size assertion. Size assertion of sec asking is neglect too display Assertion failure message: "The outcome was the incorrect size: It was 10,256 bytes, but should convey been less than or equal to 5,000 bytes."

This way y'all tin operate size assertion inward your jmeter software charge examine conception to assert size of asking response.

More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post