New to Postman but have an urgent requirement to extract some data for several hundred devices. I am looking to use the runner to extract a version for multiple devices. From what I can see the easiest way would be to get these values displayed into test results so I can download them. I have created the below post test script but the software version is not displayed. I have also tried to use a similar script with const but still fails.
Post test script;
let ips = pm.response.json().data
pm.test(‘IPS Version ${ips}’, function () {
pm.expect(29181.280.s).to.eql(29181.280.s);
});
You should use the console logs to extract specific data, or Postman has a handy visualizer tool that allows you to format responses.
If you are new to Postman, you really ought to go to the Learning Centre and learn the basic features of Postman first so you know what the art of the possible is.
When you say, several hundred devices. Do you all mean of the devices in a single request, or do you have to loop through all of the devices because the request only returns a single device.
That test doesn’t make sense by the way. You are just testing the same reference. This should error as it appears this should be a string.
Thanks for taking the time to reply. I know the test are used for test success etc but for ease it was better to print the outout required into the test so I could get our OOH staff to manually check the results. This is only a shot term fix until the manufactuere fix’s a bug for IPS updates.
I figurered out the code required. Below is the post test script incase anyone else needs the same;
ips = pm.response.json();
var version = ips.data[0][“last-updated”]