0
votes

I need to run a HTML request multiple times based on a regular expression extractor applied on the same request. I have put the HTML request under while controller however, I am stuck with writing the correct javascript code in while controller.

enter image description here

Here is the while controller code: ${__javaScript("${uidvalue}"=="test")}.

I want the loop to end as soon as a uidvalue from the regular expression extractor is found. Can anybody help me with this?

1

1 Answers

0
votes

If I understood your questions correctly, you want to keep on executing one request until response contains specific text. I am able to do that by using JMeter's while controller.

  1. Add While Controller to Test Plan.
  2. Add request and Put Counter (Add-> Config Element-> Counter) Please find following image 1 for reference of Counter
  3. Put condition in While Controller following: ${__groovy(("${Status}"!="Success") && ${count} <= 5)} Always use count to repeat request and avoid JMeter to go in infinite loop.Here I am waiting for 'Success' status and executing request 5 times only. Please find following image 2 for reference of While loop

Thank you, I hope this helps.