I want to build an automation testing, so I have to know the errors that appear in the console of chrome.
there is an option to get the error lines that appear in th
This is the c# code for logging the brower log from chrome.
private void CheckLogs()
{
List logs = Driver.Manage().Logs.GetLog(LogType.Browser).ToList();
foreach (LogEntry log in logs)
{
Log(log.Message);
}
}
here is my code for the actual log:
public void Log(string value, params object[] values)
{
// allow indenting
if (!String.IsNullOrEmpty(value) && value.Length > 0 && value.Substring(0, 1) != "*")
{
value = " " + value;
}
// write the log
Console.WriteLine(String.Format(value, values));
}