Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Test if json list has max lenght of 5 POSTMAN, JS

I gotta assert that a json list can have a maximum of 5 elements. My problem is how do I do this in postman framework.

The list can have either 1 or 5 elements, this is dynamic, i gotta verify it never has more than 5.

var data = JSON.parse(responseBody);
data.servers.lenght would return the number of elements in the list

Any ideas?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

So the answer is quite simple using .below already provided by postman

pm.test("Less than 6 servers.", function () { 
    pm.expect(data.servers.length).to.be.below(6);
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!