Help me
You donโt have anything in the initial value as per the instructions.
Then write a script to see how many species included in the first page of results have an average height greater than 100. Log this number to the console. Save this number as a collection variable called
talls
, and then persist the data so thatINITIAL VALUE
andCURRENT VALUE
are the same.
Current values do not get copied to the Postman Cloud, so the tests in the submit request are checking against the initial value.
let variable = collection.variable.find(variable => { return variable.key === "talls" })
pm.expect(variable.key, 'check collection variable key').equals("talls")
pm.expect(parseInt(variable.value), 'check collection variable value').equals(7)
In particular, I suspect this bit is failing as it will return as null (therefore Nan - not a number).
parseInt(variable.value)
1 Like