title: Looping Requests in Postman (using POST Requests)
body: <p>I have a data file with over 10,000 requests and I need it to loop through each test.</p>
  
  <p>Example of text file:</p>
  
  <pre><code>text1~text2~text3
  text1~text2~text3
  etc.
  </code></pre>
  
  <p>My test script is:</p>
  
  <pre class="lang-py prettyprint-override"><code>pm.test("Status code is 200", function ()
      {
          pm.response.to.have.status(200);
      }
  );
  
  if ((pm.response.json()[0].ResultCode)===-1)
  {
      pm.test("ResultCode -1 Matched!", function ()
      { 
          pm.expect(pm.response.json()[0].ResultCode).to.equal(-1);
      });
  }
  
  if ((pm.response.json()[0].ResultCode)===-5)
  {
      pm.test("ResultCode -5 Matched!", function ()
      { 
          pm.expect(pm.response.json()[0].ResultCode).to.equal(-5);
      });
  }
  </code></pre>
  
  <p>So the first test works and the second test works, but it stops testing furthermore.</p>
  
  <p>The is my output of the tests tab:</p>
  
  <p><a href="https://i.stack.imgur.com/2JDQn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2JDQn.png" alt="Postman Result"></a></p>
  
  <p>I know that it has tested all the requests, as the body shows all the results; i.e.:</p>
  
  <pre><code>[
     {
         "ResultCode": -1
     },
     {
         "ResultCode": -1
     },
     {
         "ResultCode": 200,
         ...
     },
     ...
  ]
  </code></pre>