Reputation: 107
My test plan structure is
Thread Group
--Http request
while loop controller
--http request
--regular expression extractor (get a login config key which is used in while loop)
Regular expression:-"business_type":"(.+?)"
variable name :-business_type
while loop condition: :- ${__javaScript(("${business_type}" === "Apparel & Footwear" && ${counter} < 5),)
I want to stop while loop when the expected business type is found in response.
Upvotes: 0
Views: 1682
Reputation: 58772
You need to check 2 condition while one for negative equal the string in While Controller:
${__jexl3(${counter} < 5 && "${business_type}" != "Apparel & Footwear")}
Prefer __jexl3 over __javascript function:
Checking this and using __jexl3 or __groovy function in Condition is advised for performances
Upvotes: 1
Reputation: 1999
Try using "!=" instead of "===". ${__javaScript("${business_type}" != "Apparel & Footwear" && ${counter} < 5)}
Upvotes: 0