apache / apache/jmeter

Assertions not working correctly for sub-samples

Open
#5,755 2 comments 0 reactions 0 assignees View on GitHub
defect to-triage
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

### Expected behavior

When I create an assertion in an HTTP sampler that has a redirection as a response and I need to add an assertion to the sub-sample, when I select the radio button "Sub-samples Only" in the Response assertion component, that assertion should only be applied to the sub-sample, and not to the main request.

### Actual behavior

When I add an assertion with the "Sub-samples Only" selected, that assertion is failing in the main sampler where it shouldn't be evaluated

### Steps to reproduce the problem

Record a script that has a redirection e.g navigate to http://google.com. that has a response Response code:302 and redirects to another page that has the final HTML. Add an assertion to validate that final HTML and select the option "Sub-samples Only" to avoid validating the assertion in the main/initial request then run the script and the assertion fails.

### JMeter Version

5.5

### Java Version

openjdk version "1.8.0_212" OpenJDK Runtime Environment (Zulu 8.38.0.13-CA-win64) (build 1.8.0_212-b04) OpenJDK 64-Bit Server VM (Zulu 8.38.0.13-CA-win64) (build 25.212-b04, mixed mode)

### OS Version

Windows 10 Entrerprise 21H2 OS build 19044.2251

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.