Reputation: 157
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.
Upvotes: 3
Views: 8730
Reputation: 23
For Multiple Condition in While Loop using Groovey Function for '&&' and '||' for the same field.
${__groovy(!(vars.get('ocrstatus_1').equals('500') || vars.get('ocrstatus_1').equals('1000')) ,)}
Upvotes: 0
Reputation: 6398
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:
Upvotes: 3