c# console log json

15 views
Skip to first unread message

benoit riendeau

unread,
Jan 23, 2022, 11:37:20 PM1/23/22
to Selenium Users
Hello, 

I want to get the json data from the console log in c#.

Here is the code :

*****************************************************************************

           ChromeOptions options = new ChromeOptions();

            List<string> ls = new List<string>();
            ls.Add("enable-automation");
            ls.Add("enable-logging");


            options.SetLoggingPreference(LogType.Browser, LogLevel.Info);
            options.AddExcludedArguments(ls);
            options.AddArgument(@"--user-data-  dir=user_directory");
            options.AddArgument("--start-maximized");

            IWebDriver driver = new ChromeDriver(options);
            driver.Navigate().GoToUrl("URL");
            var entries = driver.Manage().Logs.GetLog(LogType.Browser);

*****************************************************************************

in the var entries I have the info console log data but not the json data. 

any way to have it ?

Thank you
Benoit Riendeau

selenium support.png
Reply all
Reply to author
Forward
0 new messages