When I get a response in Postman, I want to be able to set an environment variable (using
pm.environment.set("variable_key", "variable_value");
when a condition is met from the response array.
So the requirements:
-
set an environment variable named
idForAbcto the value ofsomeArray.idwheresomeArray.criteria = "ABC"(soidForAbc = 1) -
set an environment variable named
idForXyzto the value ofsomeArray.idwheresomeArray.criteria = "XYZ"(soidForXyz = 2)
Here is my sample response:

Aucun commentaire:
Enregistrer un commentaire