Capturing Selenium Logs for Chrome and Firefox


Capturing Selenium Logs for Chrome and Firefox


In this article, we will be learning how to Capture the selenium logs for chrome and Firefox browser.

Please Note this log is different from other logs like log4j as these logs are generated automatically whenever we execute an automation suite.

Selenium Logs for Chrome Browser

For Capturing selenium execution logs in case of Chrome browser we need to make a small change in System.SetProperty and provide the “webdriver.chrome.logfile” as a first argument and provide the path of logs file where we want to store the execution logs as the second argument.

Complete Code implementation in case of Chrome would be like this

Chrome Execution Result

Selenium logs for Firefox Browser


For capturing Selenium execution logs in case of a firefox browser we need to pass BROWSER_LOGFILE as a first argument in System.Property and provide the path of logs file where we want to store the execution logs as the second argument.



Complete Code implementation in case of Firefox would be like this


FireFox Execution Result




SHARE THIS

Author:

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