title: Jmeter- how to break while controller after getting successful repsonse
body: <p>I am seeking help on how to break while controller loop when I got successful response.</p>
  
  <pre><code>Steps:-
  1. I have a while controller where I kept below logic
  ${__javaScript((${controller} &lt; 5),)}
  2. And inside while controller I have created http request which return response.
  This request takes some time to give result.if this request is still
  running it will return status code 202.. and if this request is completed it will give 200.(I have another API to check this)
  
  So here I dont know when it will get success.
  for that after each request I have kept waiting time.
  So when I call first time after while loop.. its giving 202(because its still running)
  and I will continue this process till 5 times..
  So here there is chance I can get 200 success code at 3rd request.
  So what I want here is I would like to break the loop after that..I dont want to run till 5 times.
  
  I am using below code to read the response.
  
  if (status_code == "200"){
              AssertionResult.setFailure(false); 
      }
  </code></pre>
  
  <p>So when I get the 200 from response it should stop and get success
  and if I dont get 200 from response in all 5 attempts, it should get failed.</p>