Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

219
Visualizações
Debug output in tests

How do I output some information in Postman tests?

console.log(tv4.error);
tests["Valid Data1"] = tv4.validate(data1, schema);

console.log() seems to be working but I want to output my info into the same panel where my assertions go (for easier correlation):

enter image description here

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Just make a fake test that passes:

var jsonData = JSON.parse(responseBody);
tests["id = " + jsonData.id] = true;              // debug message
tests["name = " + jsonData.name] = true;          // debug message
over 4 years ago · Santiago Trujillo Relatório

0

Reference for the people who just want to use Chrome’s Developer Tools (which will let you see console output and give you many more features)

To enable it

  1. Type chrome://flags inside your Chrome URL window
  2. Search for "Debugging for packed apps" setting
  3. Enable the setting
  4. Restart Chrome

You can access the Developer Tools window by right clicking anywhere inside Postman and selecting "inspect element".

You can also go to chrome://inspect/#apps and then click "inspect"

Reference

over 4 years ago · Santiago Trujillo Relatório

0

I used this, which isn't the prettiest, but it works for what I needed.

tests["your test name here " + data.data.length] = data.data.length > 100;
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda