My response body returns this:
"ServerList": {
"192.168.88.128": {
"encryption": "None",
"host": "192.168.88.128"
}
I’m trying to test for encryption using this:
const response = pm.response.json();
pm.test("Server Encryption Check", function () {
pm.expect(response.ServerList.192.168.88.128.encryption).to.eql("None");
});
Can’t seem to find a way to be able to have that ip in the test without a syntax error.
>Solution :
You can reference the property as an indexer:
response.ServerList["192.168.88.128"].encryption