Created
October 11, 2021 16:33
-
-
Save jimevans/35ec33c0c7c7e0e326743869e4d103e4 to your computer and use it in GitHub Desktop.
Selenium C# JavaScript Console Log monitoring example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IJavaScriptEngine monitor = new JavaScriptEngine(driver); | |
List<string> consoleMessages = new List<string>(); | |
monitor.JavaScriptConsoleApiCalled += (sender, e) => | |
{ | |
Console.WriteLine("Log: {0}", e.MessageContent); | |
}; | |
await monitor.StartEventMonitoring(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment