Postman Scripts to Compare Responses

(I know there are JS Discords, but the expertise here is just always so much better, and I'm not looking for language help.) I have a VS2022 solution with two multi-project start-up configs, and I need to run Postman tests against both of these and compare responses. My first idea is to run a collection against an environment configured for one start-up, save the response JSON, and then either: a) run the collection against another environment set up for the other start-up and use a post-request script to compare responses against those saved on the first environment. b) run the collection twice, against the same environment, but automate starting up the solution once for each run, using a different start-up config each time and compare the response JSONs. This is preferable, because the projects used in each start-up currently have the same port numbers etc. It's quite an effort to create new launchsettings for each project, for each startup. I've done some reading about saving response, but haven't found too much. JS isn't really an ideal tool for local disk access, so my first question is how to save the responses. My second question is how to automate starting up VS2022 using different start-up configs, but this is a much lower priority question.
4 Replies
Rory
Rory2w ago
I'm no postman expert but I think at this level of orchestration I'd be thinking of moving my testing setup into C#, and/or setting up my solution so that I could run multiple services on separate ports at the same time. I'm assuming theres reasons why you are doing it this way though.
VoidPointer
VoidPointerOP2w ago
Thanks. I would much rather do tests from a C# integration test project, but it's a current team convention to use Postman, and I need to get a few basic tests running there before doing stuff my way. I am already running multiple services on separate ports, but we have two of each service, one for v4 and one for v5, and the pain point I mentioned is that each of these two has the same launchSettings.json, so my first idea is to have one start-up config for v4 projects, and run the collection using that start-up, then run it again using the start-up for v5 projects and compare the saved responses.
Rory
Rory2w ago
Argh, i worried that the postman thing might just be the cause of team convention or something. Fair enough. Makes painful sense, I don't know enough about postman to advise further sorry!
VoidPointer
VoidPointerOP2w ago
It is quite painful, hehe. Luckily our new principle engineer, like me, prefers .NET based integration tests, but he started the same day as me, still early days.

Did you find this page helpful?