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
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