If controller in jmeter

Click test plan add a new variable with name = tool and value = jmeter. Since this value is defined at Test Plan level so it is available to all threads we create in our test plan.

Add a new thread group

Add a if controller.And two requests to this controller.In if controller in Condition(Default Javascript) type

 "${tool}"=="jmeter"

And a new Debug sampler to the thread group as well.

Then if we run the test plan it will execute both the tests as x declared in test plan is equal to jmeter and so value given in if condition is true.

If we try something like this

 "${tool}"=="loadrunner" 
then non of the requests will be executed as the condition will be false.

The respnse data of debug sampler defined after the if loop can we used to check the actual value of tool variable.