How Assertion Scope Works
Assertions are used to validate a response.
Note
Out of the box, JMeter considers all 4xx and 5xx responses as failures.
Like Timers, assertions have rules, too.
These rules apply regardless of the location of the assertion.
Rule 1: Assertions Are Executed after Each Sampler in Their Scope or to Parent Samplers
Example 1:
- Assertion will validate the responses from Sampler1 and Sampler2:
Figure 4.15: Example 1
Example 2:
- Assertion1 will validate the response from Sampler1:
- Assertion2 will validate the response from Sampler2:
Figure 4.16: Example 2
Example 3:
- Assertion1 will validate the response from Sampler1:
- Assertion2 will validate the responses from Sampler1 and Sampler2:
Figure 4.17: Example 3
Example 4:
- Here, Assertion1 will validate the responses of Sampler1 and Sampler2: