jmeter if controller with loopin to same http request

532 views Asked by At

I have a jmeter test plan with if controller, I need to loop the same http request until the if condition become true. if role==3664v then continue otherwise repeat the same http request page

1

There are 1 answers

0
Dmitri T On

I believe you should place your sampler under the While Controller and use the following condition (assumes __javaScript() function) :

 ${__javaScript("${role}" != "3664v",)}

You will need to extract this ${role} variable from the HTTP Request sampler response using Regular Expression Extractor or any other matching Post Processor

Assuming this setup JMeter will loop the HTTP Request until ${role} variable value is not equal to 3664v. When the role becomes 3664v it will continue.

See Using the While Controller in JMeter for more detailed information on implementing the "while loop" concept in JMeter tests.