Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.
Here’s an outline with best practices for making your inquiry.
My question:
Hi, long story short is I’m looking for a way to alternate the return value of a mock server endpoint from one request to the other. My mock server is based on an API my app service is expected to hit; it will repeatedly hit a specific endpoint for data until the return ID eventually returns as a blank string rather than a Guid (see below), providing an exit condition for my loop.
I have created an example for the endpoint where a ‘returnUuid’ collection variable is returned, and written a pre-requisite script that will update the value of that variable based on its current value, alternating between a new random guid and an empty string.
Hitting the endpoint repeatedly in Postman shows that this does work; however hitting it from either a browser or from my app shows the value not changing from whatever it happens to currently be set to. I may be making the incorrect assumption that scripts would run in this situation. If so then is there another way to acheive what I’m looking for here?