setNextRequest won't run

Hi @hoangdh1012,

If you using the same code as above. you need to initialize the count variable elsewhere. The code in the test will be executed every time the request runs and your variable will be initialized at 0 every time causing the loop. You should set that variable up as a collection variable. You can retrieve the collection variables from the test script section using pm.collectionVariables.get().

Check out similar post. How do I set a Collection variable?