Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to find chromedriver.log in selenium using c#. Where can i see the log file of chromedriver?

Where to find chromedriver.log in selenium using c#. Where can i see the log file of chromedriver?

ChromeOptions optn= new ChromeOptions();
optn.AddArgument("--verbose");
optn.AddArgument("--log-path=D:\\chromedriver.log");
var driver = new ChromeDriver(@"D:\Driver\",optn);
driver.Navigate().GoToUrl("https://www.google.co.in/?gfe_rd=cr&ei=aWh0U7WHEJGAuASTuYHIAQ");

I'm using the above code but unable to see the log file in specified location. Please help me to find it

like image 561
Shridhar Kalagi Avatar asked May 15 '14 08:05

Shridhar Kalagi


People also ask

Where does Chromedriver save Selenium?

Now we need to move ChromeDriver somewhere that Python and Selenium will be able to find it (a.k.a. in your PATH ). The easiest place to put it is in C:\Windows . So move it there!

How do I know if Chromedriver is working?

Execute google.py - A new chrome browser is open and redirect to www.google.com. Execute yahoo.py - If webdriver. Chrome is executed/existed, then assign the browser to driver variable. Else launch new browser.


1 Answers

I think what you're looking for is something like this:

var optn = new ChromeOptions();
var service = ChromeDriverService.CreateDefaultService(@"D:\Driver\"); 
service.LogPath = "chromedriver.log";
service.EnableVerboseLogging = true;
var driver = new ChromeDriver(service, optn);
driver.Navigate().GoToUrl("https://www.google.co.in/?gfe_rd=cr&ei=aWh0U7WHEJGAuASTuYHIAQ");

The ChromeOptions is for the browser process itself. Logging goes to the ChromeDriver by setting the ChromeDriverService variables.

like image 164
Gabor A Avatar answered Sep 21 '22 08:09

Gabor A