jmeterjexl

JMeter _jexl3 function with multiple conditions


I'm a newbie in Jmeter 4.0.

I want a single IF controller in my Thread group executing True or False relation using Boolean ie; 0 and 1.

Currently i'm using two IF controllers with the expressions ${__jexl3(${VAR}==1)} and ${__jexl3(${VAR}==0)} and a single User Defined Variable with value Count==0.

The results are correct but I want it in a single IF controller.


Solution

  • Use vars.get instead of ${} syntax and use || for concatenating or conditions:

    ${__jexl3(vars.get("VAR")=="1" || vars.get("VAR")=="0")}