JMeter correlation problems are easier to fix when the test plan can show the values it is carrying between samplers. The Debug Sampler creates a normal sample whose response data lists selected variables or properties, which makes it useful for checking extractor output, function results, and runtime overrides during a small validation run.
The sampler belongs in the same scope as the value being checked. Place it after the extractor, preprocessor, function-driven sampler, or configuration element that should have produced the value, then inspect the sample with View Results Tree while the plan is reduced to a short debug run.
Keep the output narrow and temporary. Enable only the value groups needed for the problem, and remove or disable both Debug Sampler and View Results Tree before a real load run because debug listeners and large response data can add avoidable client memory and CPU overhead.
Steps to add a JMeter Debug Sampler for a debug run:
- Open the test plan in the JMeter GUI.
- Select the thread group, controller, or sampler scope that can see the value being checked.
- Add the sampler from Add → Sampler → Debug Sampler.
- Move the Debug Sampler after the element that creates the target variable or property.
For extractor checks, place it after the sampler and post-processor that should have set the variable.
- Rename the sampler for the value being inspected, such as Debug checkout variables.
- Enable JMeter variables.
- Leave JMeter properties and System properties disabled unless the issue is a property override or JVM setting.
Those options can produce long output, so turn them on only for the specific debug question.
- Add View Results Tree under the same temporary debug scope from Add → Listener → View Results Tree.
View Results Tree is for functional testing, debugging, and validation, not load testing. Disable or remove it before increasing users, loops, or duration.
Related: How to debug a JMeter sampler with View Results Tree - Reduce the debug run to one thread and one loop before starting it.
- Start the debug run.
- Select the Debug Sampler result in View Results Tree.
- Open Response Data → Text.
- Confirm that the expected variables appear in the debug response.
$ cat debug-sampler-output.txt JMeterVariables: checkout_token=token-abc-123 debug_user=qa-user-01
In the GUI, the same lines appear in the Response Data pane. The saved file form is useful when a short non-GUI smoke run or review note captures the Debug Sampler output.
- Fix the extractor, function, property, or sampler that produced the wrong value.
- Run the one-thread debug check again until the Debug Sampler output shows the expected value.
- Disable or delete the Debug Sampler before preparing the real load run.
- Disable or delete View Results Tree before preparing the real load run.
- Save the load-ready test plan.
- Confirm the load-ready tree no longer contains the temporary Debug Sampler or View Results Tree elements.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.