Skip to content

Compare Assertion

Configure the JMeter Compare Assertion assertions: properties, defaults, and practical usage notes for building reliable load tests.

Difficulty
intermediate
Guide type
reference
Estimated read time
1 min read
Last verified version
Verified JMeter 5.6

Part of the Assertions category. Also documented in context in the full Component Reference.

Compare Assertion

The Compare Assertion can be used to compare sample results within its scope. Either the contents or the elapsed time can be compared, and the contents can be filtered before comparison. The assertion comparisons can be seen in the Comparison Assertion Visualizer.

NameRequiredDescription
NameNoDescriptive name for this element that is shown in the tree.
Compare ContentYesWhether or not to compare the content (response data)
Compare TimeYesIf the value is ≥0, then check if the response time difference is no greater than the value. I.e. if the value is 0, then the response times must be exactly equal.
Comparison FiltersNoFilters can be used to remove strings from the content comparison. For example, if the page has a time-stamp, it might be matched with: “Time: \d\d:\d\d:\d\d” and replaced with a dummy fixed time “Time: HH:MM:SS”.
On this page