Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple conditions in while controller

Tags:

jmeter

Is it possible to add two conditions in while controller? My two conditions are Complete ="True" and Results >200.

I tried using it by setting Complete = False and Results=0 in user defined variables and used it in while controller as follows:

${__javaScript("${Complete}" != "true")} && ${__javaScript((parseInt(${Results}) >90)}.

But it is looping indefinitely. Please help.

like image 718
Ashley Avatar asked Sep 12 '26 05:09

Ashley


1 Answers

Try the following condition (working for me):

${__jexl3("${Complete}" == "False" && ${Results} >= 0,)}

where Complete - False & Results - 0.

For above values, condition will be evaluated to true, hence executes the children of the While Controller.

Note: Please change the conditions == & >= symbols and values False && 0 as per your requirements.

You must reset the values inside the While Controller, to make the condition evaluated to false, otherwise you will struck in infinite loop.

References:

  1. https://jmeter.apache.org/usermanual/component_reference.html#While_Controller
  2. https://www.blazemeter.com/blog/using-while-controller-jmeter
like image 86
Naveen Kumar R B Avatar answered Sep 13 '26 20:09

Naveen Kumar R B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!