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:

  1. Open the test plan in the JMeter GUI.
  2. Select the thread group, controller, or sampler scope that can see the value being checked.
  3. Add the sampler from AddSamplerDebug Sampler.
  4. 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.

  5. Rename the sampler for the value being inspected, such as Debug checkout variables.
  6. Enable JMeter variables.
  7. 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.

  8. Add View Results Tree under the same temporary debug scope from AddListenerView 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

  9. Reduce the debug run to one thread and one loop before starting it.
  10. Start the debug run.
  11. Select the Debug Sampler result in View Results Tree.
  12. Open Response DataText.
  13. 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.

  14. Fix the extractor, function, property, or sampler that produced the wrong value.
  15. Run the one-thread debug check again until the Debug Sampler output shows the expected value.
  16. Disable or delete the Debug Sampler before preparing the real load run.
  17. Disable or delete View Results Tree before preparing the real load run.
  18. Save the load-ready test plan.
  19. Confirm the load-ready tree no longer contains the temporary Debug Sampler or View Results Tree elements.