Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 393
UserControl Avatar asked Jul 01 '15 09:07

UserControl


People also ask

What is a debug output?

Debug Output is an OpenGL feature that makes debugging and optimizing OpenGL applications easier. Briefly, this feature provides a method for the driver to provide textual message information back to the application.

How do I show debug output?

To see the debug output window, in Microsoft Visual Studio, click View, click Other Windows, and then click Output. You can view the debug output in this window only if the debugger is attached to the process that is writing to the output window.

What is a debug test?

Debugging refers to halting the test execution on a certain keyword test operation or script line and then running through the test in step with the execution, stopping on operations or script lines.


2 Answers

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 
like image 173
Veener Avatar answered Sep 27 '22 16:09

Veener


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

like image 28
cilerler Avatar answered Sep 27 '22 18:09

cilerler