Recently, while working on a project using Selenium HtmlUnitDriver, i found that it generates too much log messages by default to output console which really fills the screen with non wanted messages.
So, like me some of you may also get this and wanted to resolve the same. What i did is added the below code statements to suppress the logging messages.
So, like me some of you may also get this and wanted to resolve the same. What i did is added the below code statements to suppress the logging messages.
LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log","org.apache.commons.logging.impl.NoOpLog");
java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF);
java.util.logging.Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF);
and it Worked :) :)
3 comments:
[img]http://s20.postimg.org/gfz8soewd/how_to_disable_selenium_htmlunitdriver.png[/img]
This worked perfect for me too! Although I had to alter my log4j.properties file to the following to make it work properly. Thank you!!!
# Root logger option
log4j.rootLogger=WARN, file
Hey Thanks John, for adding your solution
Post a Comment