Here I'm facing one problem with if controller.using JSR223 Assertion to Extract the Response in Jmeter like this it is in One Thread Group

def threadName = Thread.currentThread().getName()
threadName = threadName.substring(threadName.lastIndexOf('-') + 1)

def response = new groovy.json.JsonSlurper().parse(prev.getResponseData())

props.put('Error_code_' + threadName, response.error)
props.put('Id_value_' + threadName, response.error_description)

so it is giving like this output



in very Next Thread Group i am validating Error_code_ in side if Controller like this


and i am putting id_values inside Http request there are 3 Http request.So when i run script the if condition is not properly validating. it also taking 400 error code also is there any way to see what value passing if condition or print it log file or else any thing wrong in this approach please tell me is there any alternative to this stuff.please explain me with simple demo.



1 Answer 1


The easiest way of debugging If Controller is enabling logging for it, you can do it in 2 ways:

  1. From JMeter GUI having the If Controller selected choose Help -> Enable Debug

    JMeter enable Debug

  2. Or by adding the next line to log4j2.xml file (lives under "bin" folder of your JMeter installation)

    <Logger name="org.apache.jmeter.control.IfController" level="debug" />

In both cases you will see what values are being evaluated and what is the outcome in jmeter.log file

JMeter Log File - If Controller - Debug

See How to Configure JMeter Logging article for more information.

Individual JMeter properties and variables names/values can be visualised via Debug Sampler and View Results Tree listener combination.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.