Hi,
my response returns more than 10k values and i have to assert them with expected values.
If there are few, we can test them line by line like:
ex:
pm.expect(pm.globals.get(“Actualvalue1”)).to.equal(pm.globals.get(“Expectedvalue1”));
pm.expect(pm.globals.get(“Actualvalue2”)).to.equal(pm.globals.get(“Expectedvalue2”));
what if we have more then 10k values?
If i save them in a file then compare two files, in the case there is an error, the test will fail but i will have to check line by line for errors.
What is the best solution?
Thank you
You see these values? there are more than 10 000 values.
each is differents.
like
Atualvalue1 = abc123
Actualvalue2 = qwe321
…
…
what i did is to save the response body in a variable and then parse for each value.
Here i put only 3 data.
In the real example there are more than ten thousand data.
i need to validate each data like:
The first City == Paris
The second City == Tokyo
The first Name == Paris
The second Name == Tomo
…
just store the expected values as array and then use is filter. This isfilter returns the unequal values, if there is no unequal values then returns empty array. so we are validating the returned output is empty