Postman check if response value is greater than or equal to another value

2.9k views Asked by At

I have a request in which a filter is added in the URL itself. Let the filter be named minAgeDecimal. In the response i should get listings with a variable AgeDecimal which is greater than or equal to the requested MinAgeDecimal value. Sample MinAgeDecimal value=2. Sample AgeDecimal value in response="AgeDecimal": "6.00". I tried this code

pm.test("Check if AgeDecimal is more than the MinAgeDecimal filter ", function () {
    pm.expect(AgeDecimal).to.be.above(MinAgeDecimal);
});

But im getting an error: Check if AgeDecimal is more than the MinAgeDecimal filter | AssertionError: expected '6.00' to be a number or a date.

0

There are 0 answers