Skip to content
Shirish Kawatkar edited this page Mar 20, 2018 · 3 revisions

Logging

Logging feature uses log4j which is a popular logging framework distributed under the Apache Software License. You can configure the level of the root logger, appenders, and layout from config/log4j.xml

The current configuration is giving logs in the following format:

  • 2018-03-20 14:11:18 INFO MyLogger:60 - Logger is initialized..
  • 2018-03-20 14:11:20 INFO MyLogger:148 - CHROME driver is initialized..
  • 2018-03-20 14:11:20 INFO MyLogger:18 - Open Google Search URL.
  • 2018-03-20 14:11:21 INFO MyLogger:21 - Get input string from properties file and put it into the search box.
  • 2018-03-20 14:11:22 INFO MyLogger:42 - Enter text to search: dev environment
  • 2018-03-20 14:11:22 INFO MyLogger:25 - Assert actual searched string with expected string from properties file.
  • 2018-03-20 14:11:22 INFO MyLogger:48 - Select first option displayed by google search
  • 2018-03-20 14:11:22 ERROR MyLogger:242 - Actual string: [ dev environment ] does not match with Expected string: [ dev environment1 ]
  • 2018-03-20 14:11:22 ERROR MyLogger:222 - Captured Screenshot for Failure: /home/shirish/Projects/Automation/Selenium/Java-Selenium-TestNG-Automation-Framework/screenshot/sanitySuite/20180320141122401_https___www.google.co.in_.png
  • 2018-03-20 14:11:22 INFO MyLogger:35 - Click on first search option
  • 2018-03-20 14:11:22 INFO MyLogger:54 - Select first option displayed by google search
  • 2018-03-20 14:11:24 INFO MyLogger:257 - Closing Browser.
Clone this wiki locally