Logging - Do's & Don'ts

[Me]:- Guruji, I was wondering how important logging is for automation.

[Guruji]:- Logging is imperative for the successful release of any product. It is required for ensuring that enough test cases are passing and release criteria is being met with. Without proper logging, there is no way of determining, if a component meets the QA needs as prescribed. The logging infrastructure has to be robust.

[Me]:- And what about error reporting?

[Guruji]:- Error reporting is one of the crucial aspects of logging required for test cases. Errors, Warnings and informational messages should be context sensitive and be able to point to the source of the problem in the test code. They should also be as much unique as possible so that a result from a wild card search should be able to point the test suite and the test Case the error message belongs to.

[Me]:- So, can you please summarize the Do’s and Don’t of logging.

[Guruji]:- ok



  • Do use the logging infrastructure provided by the operations team.

  • Do use only one Pass or one Fail per test case.

  • Tests should always log a result per test case.

  • Do Use multiple warnings instead of failures.

  • Log as much information needed for easier troubleshooting.
  • Log the state of your objects for easier troubleshooting
  • Use custom logging only in conjunction with logging provided by operations team.

  • Do not log multiple passes/failures per test case.

  • Do not instantiate your own version of the Logging object provided by operations team.

  • No “No repro on rerun” explanations.

  • Do not log a failure in place of warnings. A failing Test case should report only one failure.


Vinay Jagtap

A hard core Technocrat with over a decade of extensive experience in heading complex test projects coupled with real time experience of project management and thought leadership. Extensive experience in Performance, Security and Automation Testing and development of automation frameworks and ability to setup and execute Global service centers and Center of Excellences for testing.

Get Free Email Updates to your Inbox!


Powered by Blogger.


Total Pageviews

Copyright © T R I A G E D T E S T E R