Hey @sjeefr ,
Perhaps there is a better approach than the one I’m suggesting however hopefully it may help you. I’m not entirely sure you’ll be able to accomplish your use case with the mock, but you could also make use of Postman Echo by using the post endpoint https://docs.postman-echo.com/?version=latest#083e46e7-53ea-87b1-8104-f8917ce58a17 That endpoint should echo the contents of the request body and thus helping you test.
The following suggestion may be better suited for your needs. You could leverage the use of Dynamic Variables i.e https://learning.postman.com/docs/postman/variables-and-environments/variables-list/#names to generate a random first name and random last name in your example response, e.g:
You’d then create environment variables such as
randomlastName and set the request body to something like:
And the final step would be to set up your
test scripts to set the respective values of
randomLastName from the response body. Example:
var jsonData = pm.response.json();
Hopefully, you found this information helpful and useful.