Friday, February 19, 2016

Jmeter - Size Assertion Amongst Example

| Friday, February 19, 2016
Size assertion inwards jmeter software charge examine innovation is useful to assert the byte size of asking response. You tin purpose dissimilar weather inwards answer assertion like equal to, non equal to, greater than, less than, greater than or equal to, less than or equal to a given position out of bytes for response. Here nosotros volition larn how to purpose size assertion inwards your jmeter software charge examine innovation to assert size of response.

Add Size Assertion In Test Plan
Practically nosotros need 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 instance to demo yous how genuinely size assertion works. I convey added two HTTP requests amongst size assertion equally shown inwards 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)

s 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 departure inwards both assertion's config is type of comparison.

Both HTTP request's config is same equally bellow.


When yous run higher upward examine plan, Result volition looks similar bellow.


In trial yous tin encounter that 1st asking is top away that agency asking answer size is greater than or equal to 5000 bytes which nosotros convey laid inwards 1st request's size assertion. Size assertion of s asking is neglect in addition to display Assertion failure message: "The trial was the incorrect size: It was 10,256 bytes, but should convey been less than or equal to 5,000 bytes."

This way yous tin purpose size assertion inwards your jmeter software charge examine innovation to assert size of asking response.

Related Posts