Could expand the view of the request builder to show the request tabs, do any of these have orange dots on them. Not sure what you mean by ‘green’ the tab shouldn’t show any colour.
Have the created a new run or are you retrying the same one as before?
Ok. It works after reimporting the data file. But there’s still a problem; it creates requests even when the agent_id is empty. Is it possible to set conditions on the requests (drop request is variable value if null/empty)?
Something that I’ve done to handle this scenario is just to change the url the request is hitting via the prerequest script. Let’s take an example.
Say you don’t want to execute the request when gadget_id is null. You could do something like this in your prerequest script;
const gadgetId = pm.iterationData.get('gadget_id');
if(!gadgetId) {
pm.request.url = 'https://postman-echo.com/delay/0';
pm.request.method = 'GET';
pm.variables.set('skip', true);
}
else {
// If you need to do any other preprocessing if gadget_id exists
}
This will still execute a request, but instead of hitting your API, it will hit the postman echo api.
Since you don’t want tests to run (because your api didn’t actually run), you’d want to add this to your tests tab:
const skip = pm.variables.get('skip');
if(!skip) {
// all of your tests for your API
}
Essentially you’re just putting your tests behind an if statement to make sure they aren’t run if you ‘skipped’ the request.
I’ve figured it out (created tests based on the entries in the data file (expect to fail and expect to pass)) based on what’s being read (in this case the gadget_id).