C# WebDriver Chrome How to execute in silent mode?

4,622 views
Skip to first unread message

Christian LeMoussel

unread,
Sep 9, 2013, 12:05:21 PM9/9/13
to seleniu...@googlegroups.com
When using Chome Selenium-Webdriver, it  will output diagnostic output when the servers are started :  Started ChromeDriver (v2.0) on port 9515

I do not want to see these messages, how can I suppress them?

I do 

ChromeOptions options = new ChromeOptions();
options.AddArgument("--silent");
IWebDriver Driver = new ChromeDriver(options);

But diagnostic output is not suppress?





Jim Evans

unread,
Sep 9, 2013, 3:25:30 PM9/9/13
to seleniu...@googlegroups.com
The ChromeOptions.AddArgument() method supplies command-line arguments for the Chrome *browser*, not the ChromeDriver *executable*. What you want is something more like the following:


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

Christian LeMoussel

unread,
Sep 10, 2013, 1:52:15 AM9/10/13
to seleniu...@googlegroups.com
Jim, Thank's four your help. It's Ok., the Output  Started ChromeDriver (v2.0) on port 9515 is not display.
But output similar to below appears: 

[5468:8996:0404/150758:ERROR:textfield.h(156)] NOT IMPLEMENTED
Is it possible to remove this output ?

Christian LeMoussel

unread,
Sep 10, 2013, 2:51:09 AM9/10/13
to seleniu...@googlegroups.com
Microsoft Windows [version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.

chromedriver.exe -h
Usage: chromedriver.exe [OPTIONS]

Options
  --port=PORT                     port to listen on
  --adb-port=PORT                 adb server port
  --log-path=FILE                 write server log to file instead of stderr, increases log level to INFO
  --verbose                       log verbosely
  --silent                        log nothing
  --url-base                      base URL path prefix for commands, e.g. wd/url


Is it possible to use this ChromeDriver options with C# ChromeWebDriver ?

Krishnan Mahadevan

unread,
Sep 10, 2013, 5:32:06 AM9/10/13
to Selenium Users

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/430ad575-a457-4483-bce1-807dffd4a888%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Jim Evans

unread,
Sep 10, 2013, 5:50:26 AM9/10/13
to seleniu...@googlegroups.com
A quick perusal of the ChromeDriverService code[1] shows that setting the SupressInitialDiagnosticInformation property does exactly that, adding the "-silent" switch to the command line for chromedriver.exe. If using that switch is not enough to suppress the error logging of the executable, then you're out of luck. There's nothing the .NET bindings can do about it; they're already doing what you propose.

[1] http://selenium.googlecode.com/git/dotnet/src/webdriver/Chrome/ChromeDriverService.cs

Reply all
Reply to author
Forward
0 new messages