1
{
    "success": {
        "text": "successfully! deleted Records"
    }
}

Want to validate text value is "successfully! deleted Records"

I tried with this

pm.test("Your test name", function () {
    var jsonData = pm.response.json();

    pm.expect(jsonData[0].text).to.eql("successfully! deleted Records");
});

1 Answer 1

1

You're trying to retrieve data from a JSON object, not from an array. Hence, it should be as follows.

pm.test("Your test name", function () {
    var jsonData = pm.response.json();    
    pm.expect(jsonData.success.text).to.eql("successfully! deleted Records");
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.