ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Suppress error logging with Selenium WebDriver #522

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When using ChromeDriver (V 2.3) with Selenium-WebDriver output similar to below 
appears: [5468:8996:0404/150758:ERROR:textfield.h(156)] NOT IMPLEMENTED 

with this C# code (Windows 7)
ChromeOptions options = new ChromeOptions();
options.AddArgument("--silent");
IWebDriver Driver = new ChromeDriver(options);
Or this
ChromeOptions options = new ChromeOptions();
ChromeDriverService service = ChromeDriverService.CreateDefaultService();
service.SuppressInitialDiagnosticInformation = true;
IWebDriver driver = new ChromeDriver(service, options);

Is it possible to suppress the error logging of the executable ChromeDriver?

Original issue reported on code.google.com by cnh...@gmail.com on 11 Sep 2013 at 6:43

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Can you please try with below code and let us know, I have verified in latest 
version of ChromeDriver ( 2.14) with latest chrome(41.0.2272.101) and selenium 
version (2.45)  and issue is not reproducible. I'm able to suppress error 
logging and log file of chromeDriver.

     ChromeDriverService service=new ChromeDriverService.Builder()
                           .usingDriverExecutable(new File("C://path//to//chromedriver.exe"))
                           .usingAnyFreePort().withLogFile(new File ("C://path//to//logfile.txt"))
                           .withSilent(true)
                           .build();
                          service.start();

                           WebDriver driver = new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome());

                           driver.get("https://www.google.com/");
                           driver.findElement(By.name("q")).sendKeys("test");
                           System.out.println("Test Complete");
                           driver.quit();

         if ( service.isRunning() );
        service.stop();

Original comment by agau...@chromium.org on 2 Apr 2015 at 12:35