Postman Test - Validating string values in an object in an array
<p>I have a test in postman where I can validate a string value in an array but only if I know the index in which it is returned. The problem I run into is the index in which the value is returned can be random.  </p>

<p>This is what the json looks like that I'm validating.  </p>

<pre><code>{
    "cart": [{
        "offeringId": "1234",
        "offeringName": "Test1",
        "totalOfferingAmount": -15,
        "offeringTypeQualifier": "Test",
        "productTypeQualifier": "Product",
        "quantity": -1,
        "messages": [],
        "autoAdd": false,
        "autoAction": "removed",
        "addedByProcessor": true,
        "qualificationLevel": "FQ",
        "qualificationDetails": []
    }, {
        "offeringId": "5678",
        "offeringName": "Test2",
        "totalOfferingAmount": -15,
        "offeringTypeQualifier": "Test",
        "productTypeQualifier": "Product",
        "quantity": -1,
        "messages": [],
        "autoAdd": false,
        "autoAction": "removed",
        "addedByProcessor": true,
        "qualificationLevel": "FQ",
        "qualificationDetails": []
    }],
    "isCartValidForCheckout": true,
    "_status": []
}
</code></pre>

<p>Here is my postman test</p>

<pre><code>var data = JSON.parse(responseBody);
tests ["Verify offeringId"] = data.cart[0].offeringId === "1234"
</code></pre>