I have a while controller that repeats the same request until a condition is met. Inside this controller, I want to select a specific HTTP request depending on a JSON response given by a GET request outside the while loop.
Hence my logic is to set up a while controller (currently working)
${__javaScript(parseInt(${counterApis})<=parseInt(vars.get("FirstNames_matchNr")),)}
which inside has a JSR223 PreProcessor with the following:
vars.put("TypeCode",vars.get("TypeCodes_"+vars.get("counterApis")));
The Idea is simple, the while loop uses the preprocessor to check the value of the variable TypeCode (which can be ADT, CHD or INF depending on the JSON response) and then use this variable to select between a specific POST request depending on this variable.
The Problem: For some reason when I try to add an IF CONTROLLER or a SWITCH CONTROLLER inside the while controller, script crashes an does not access any of the POST requests.