How to Suppress Console Logs in Selenium

In this article, we are going to discuss one of the interesting topics on Selenium test automation on how to suppress selenium logs while executing our automation scripts on the chrome and firefox browser.

As we all know whenever we execute our automation scripts either on chrome or firefox browser along with application logs we usually get selenium execution logs as well sometimes which is very irritating for the end-user as it also results in loss of actual application logs.

FireFox Browser Logs

Chrome Browser Logs

To solve this problem in the chrome browser we can make use of silent mode.

To implement silent mode in chrome browser we need to make it true in the system.SetProperty.

Final code implementation in the case of chrome browser will look like this.

Similarly, for Firefox Browser we can make use of BROWSER_LOGFILE and pass its value as null.

Final code implementation in the case of the Firefox browser will look like this.



My Name is Ankur Jain and I am currently working as Automation Test Architect.I am ISTQB Certified Test Manager,Certified UI Path RPA Developer as well as Certified Scrum Master with total 12 years of working experience with lot of big banking clients around the globe.I love to Design Automation Testing Frameworks with Selenium,Appium,Protractor,Cucumber,Rest-Assured, Katalon Studio and currently exploring lot in Dev-OPS as well. I am currently staying in Mumbai, Maharashtra. Please Connect with me through Contact Us page of this website.

Previous Post
Next Post