Hi!
I´m trying to validate a value that appears in many results arrays. It is not possible to repeat the test every time, in this case I have 50 results, but this number is not a known value.
I have checked in help different solutions but without any success.
Could anyone help me with this? Thanks in advance!
I would need to check this value **jsondata.data[for each array].elasticScore
This is my current test:
var jsondata = JSON.parse(responseBody);
pm.test(“Elastic Score > 0 <= 1”, function () {
var jsondata = pm.response.json();
pm.expect(jsondata.data[0].elasticScore).to.be.greaterThan(0);
});
pm.test(“Elastic Score > 0 <= 1”, function () {
var jsondata = pm.response.json();
pm.expect(jsondata.data[1].elasticScore).to.be.greaterThan(0);
});
pm.test(“Elastic Score > 0 <= 1”, function () {
var jsondata = pm.response.json();
pm.expect(jsondata.data[2].elasticScore).to.be.greaterThan(0);
});
pm.test(“Elastic Score > 0 <= 1”, function () {
var jsondata = pm.response.json();
pm.expect(jsondata.data[3].elasticScore).to.be.greaterThan(0);
});