user2102611
user2102611

Reputation:

How do you turn off Logging in Selenium?

My console is getting filled up with unwanted log messages from ChromeDriver and IEDriver.

enter image description here

I've tried: Console.SetOut(TextWriter.NULL); but that doesn't work. I've tried various implementations of driver.setCapabilities(LOGGING, NOOOOO) but nothing works.

Upvotes: 3

Views: 6132

Answers (1)

JimEvans
JimEvans

Reputation: 27486

Not knowing exactly which language bindings you're using, it's a little challenging to give you the exact code to eliminate those messages, but in the case of the drivers for IE and Chrome, you want to get the --silent switch passed on the command line. For the .NET bindings, that means setting properties on the respective service classes and passing those into the driver constructor. For IE, that code would look like

InternetExplorerDriverService service = InternetExplorerDriverService.CreateDefaultService();
service.SuppressInitialDiagnosticInformation = true;
IWebDriver driver = new InternetExplorerDriver(service);

Similarly for Chrome, you'd want something like

ChromeDriverService service = ChromeDriverService.CreateDefaultService();
service.SuppressInitialDiagnosticInformation = true;
IWebDriver driver = new ChromeDriver(service);

Upvotes: 9

Related Questions