Logging to ChromeDriver.log in Selenium

We can log the error messages and Verbose to ChromeDriver.log via Selenium by using the below code

 

            System.Diagnostics.Process process = new System.Diagnostics.Process();
            System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
            startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
            // startInfo.FileName = "cmd.exe";
            startInfo.FileName = "cmd.exe";
            startInfo.Arguments = "/C chromedriver.exe --disable-extensions --verbose --log-path=chromedriver.log";
            process.StartInfo = startInfo;
            process.Start();

 

You may also like...