Automation with datafiles

newman
automation
collections
csvdatafile

#1

Hi all,

I was wondering if Newman is able to use a parsed JSON response to load a data file to be used. My scenario currently involves using 3-5 different data files that can change based on the JSON response. Is there a method to parse the JSON to set that response to an Env var then use that Env Var as input to use a different CSV.

My scenario is using CSV’s that are labeled with a series of numbers, each CSV corresponds to a specific path to take (point A to Point B, typically 600+ LAT,LON coordinate pairs ). This is to simulate driving a predetermined path. After each coordinate pair is sent as a location i have a status request that sends as well and this gives me information reagrding where i’m at, and other general information including the path that I am currently on. At the end the path a value in the status request will change to a new path.

I would like to be able to parse the JSON value from the Status Request for this Path then load the file with the same name. Is this possible?


#2

@C_Tag_Trapeze I am sure this would be entirely possible but I think you would need to do most of this work in a shell script of some sort to process things and then pass that value into the newman command line.

I cant think of a way you would be able to do this otherwise.


#3

Thanks, we were assuming this to be the only method. Just kind of hoping to not have to write and debug a shell script if PM had an inherent method to perform these actions.