I've one scenario that needs to be validated in postman.
Let's consider there's a scenario where we have to verify the list of all product information. Here is the example of response body:
{
"products": [
{
"id": 1,
"name": "Laptop",
"brand": "ABC",
"price": 1200.00,
"specifications": {
"processor": "Intel Core i5",
"RAM": "8GB",
"storage": "256GB SSD",
"display": "15.6-inch Full HD"
},
"availability": true
},
{
"id": 2,
"name": "Smartphone",
"brand": "XYZ",
"price": 699.99,
"specifications": {
"processor": "Snapdragon 855",
"RAM": "6GB",
"storage": "128GB",
"screen_size": "6.2-inch AMOLED"
},
"availability": false
},
{
"id": 3,
"name": "Headphones",
"brand": "AudioTech",
"price": 99.99,
"specifications": {
"type": "Over-ear",
"wireless": true,
"color": "Black"
},
"availability": true
}
]
}
For this, I want to verify the name, brand price for that product etc. How can this be done without having to store the expected value in any other external file. I want to make validation for this test dynamic.Let say, if there's any product information added in future, I don't want to manually come and store the expected information in excel or JSON file and then do the validation.Please note that, I don't want to first add the product and then check whether the product details there in the list.