Module 8: Logging Utility : log4j logging in Selenium Automation Framework

<<<Previous Chapter

log4j logging in Selenium Automation Framework
Hi Guys! We have already developed two utilities for our Selenium Automation framework in previous tutorials namely, 
Initializing Browsers & Capturing Screenshots 
and TestNG Listeners

Today we are going to develop our 3rd and last essential utility Log.java. It contains all the common methods that will need for our logging mechanism.

Create a Utility for logging.

Create new class with name log.java in Utility Package as we created Listeners in previous tutorial, Copy and paste below code in it: (Documentaion embedded in the snippet itself)




The methods written in  Log.java will be called by our Test suites configured via Log4j.xml file. The wait ends tomorrow! We are now ready to write our very 1st test case through the Selenium Automation framework we have created. Will try to post a video tutorial if possible while test execution. Happy Testing :)

Comments