First part I’ve managed to do, see my first response to this post.
Apologies if this question is a duplicate, I searched for similar posts but couldn’t find a clear answer.
I have a request which uses latitude and longitude parameters to return nearby assets, and I’d like to run the request against a csv of pairs of coordinates (around 100 or so pairs).
e.g. https://www.server.com/asset_list/query?longitude=123.123&latitude=123.123&search_distance=5
How do I go about setting up the pre-request script? Do I need to add all of the lat/longs as separate arrays? Do I even need to fiddle with the pre-request script?
Is it also possible to download the resulting json output per iteration? Or even merge all of the responses into one json array and then download that?
Greatly appreciate any pointers or assistance!
Aha! I’ve figured out the first part via this helpful video.
Setting the latitude and longitude as variables with identical fields in the csv file, and using the Runner to go through each row is a lot easier than I thought it would be. I like this program already.
Just have to figure out how to download the responses as it loops through now!
1 Like
@jamiecole
What on earth does that have to do with the question.
Postman uses JavaScript under the hood, not Python.
Did you just search this on ChatGPT or something?
@southbound
It looks like you have a method for looping through the coordinates and using a CSV data file is as good as any other method.
The problem is that the Postman client doesn’t have native access to the underlying file structure to save responses.
You might want to consider using Newman to run your collection in conjunction with HTMLExtra.
newman-reporter-htmlextra - npm (npmjs.com)
Or consider using another API to send your data to. For example, a SharePoint list.