Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
Postman Validate key-value pair corresponding to another key-value pair

The Response body is like:

[
    [
        {   
          "id": "1",
          "status": false
        },
        {           
            "id": "1",
            "status": false
        }
    ],
    [
        {           
            "id": "2",
            "status": true
        }
    ]
]

I have to validate if id =1, status should be false, Test gets passed

I tried this:

var jsonData = pm.response.json();

for(var i=0; i<jsonData.length; i++)
 {
   if (jsonData[i][i].Id==="1")
    {

    if (jsonData[i][i].status=== false)
      {

        pm.test("Holiday Update is Sucssesful");
        }   

​ } } But this one is getting invalid token error

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Postman test script has support for chai assertions.

var jsonData = pm.response.json();

for (subArray of jsonData){
    for (subSubArray of subArray){
        if (subSubArray.id == 1){
            pm.test("id with 1 has status false", ()=>{
                pm.expect(subSubArray.status).to.eql(false)
            })
        }
    }

}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda