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):
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.
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.
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.
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
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
chrome://flags
inside your Chrome URL windowYou 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With