Issue
When I run my Java Selenium test, the Eclipse console displays a lot of messages like:
1484171436147 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1484171436149 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1484171436152 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/GMPProvider.jsm
1484171436154 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/PluginProvider.jsm
1484171436154 addons.manager DEBUG Starting provider: XPIProvider
1484171436155 addons.xpi DEBUG startup
1484171436155 addons.xpi INFO SystemAddonInstallLocation directory is missing
1484171436156 addons.xpi INFO Mapping [email protected] to C:\Program Files (x86)\Firefox Developer Edition\browser\features\[email protected]
1484171436156 addons.xpi INFO Mapping [email protected] to C:\Program Files (x86)\Firefox Developer Edition\browser\features\[email protected]
1484171436157 addons.xpi INFO Mapping [email protected] to C:\Program Files (x86)\Firefox Developer Edition\browser\features\[email protected]
I'd like to have a cleaner log. I've tried a lot of things from other questions, but nothing works. The garbage is still there.
Here is what I have now in the @BeforeClass method in my test suit:
LoggingPreferences loggingPrefs = new LoggingPreferences();
loggingPrefs.enable(LogType.BROWSER, Level.WARNING);
loggingPrefs.enable(LogType.CLIENT, Level.WARNING);
loggingPrefs.enable(LogType.DRIVER, Level.WARNING);
loggingPrefs.enable(LogType.PERFORMANCE, Level.WARNING);
loggingPrefs.enable(LogType.PROFILER, Level.WARNING);
loggingPrefs.enable(LogType.SERVER, Level.WARNING);
desiredCapabilities.setCapability(CapabilityType.LOGGING_PREFS, loggingPrefs);
driver = new FirefoxDriver(desiredCapabilities);
How do I clean my log?
Solution
I've found an answer at the Selenium user forums:
if (driver instanceof RemoteWebDriver) {
((RemoteWebDriver) driver).setLogLevel(Level.WARNING);
}
Using this commands just after creating the driver object solved my problem.
Answered By - neves
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.