Jmeter is skipping if controller during script execution

31 Views Asked by At

I have created one jmeter script in which there are three flow stages - Start flow, edit flow and revise flow.

I have extracted the status for this flow from one of pre-request using JSON extractor.

enter image description here

I also added three if controller for each flow and added respective flow's requests inside the if controller

Start flow : ${declarationStatus} == "null"

Edit flow : ${declarationStatus} == "PREPARE"

Revise flow : ${declarationStatus} == "PROCESS"

and then have added some transaction controller after if controllers.

enter image description here

But while executing the script flow , jmeter is skipping IF controller execution and executing transaction controller ( request added in transaction controller) after IF controller.

In script, all requests are getting executed excluding if controller's request.

How can I execute the flow based on the value extracted?

I added debug sampler in script, value is properly extracted but if controller is not working.

enter image description here

1

There are 1 best solutions below

1
Ivan G On

JMeter is not "skipping" the If Controller, it's your expression which supposed to be a JMeter Function or Variable doesn't evaluate to true

Try wrapping it into i.e. __jexl3() function like:

${__jexl3( ${declarationStatus} == "PREPARE",)}

and JMeter will not "skip" your If Controller anymore.

More information: 6 Tips for JMeter If Controller Usage