Collect Console Logs with Selenium C#

2,480 views
Skip to first unread message

אסף משעל

unread,
Nov 20, 2019, 9:52:18 AM11/20/19
to Selenium Users
Hello all,

I need to find a way to collect Console log from Chrome with Selenium C#.

Can someone help me?

Thanks,
Assaf.

Oleksiy Kyrylenko

unread,
Nov 21, 2019, 3:01:52 PM11/21/19
to Selenium Users

אסף משעל

unread,
Nov 24, 2019, 6:24:28 AM11/24/19
to Selenium Users
Hello Oleksiy ,

Thanks for your quick help.
It's not working in my project,
When calling this command : var entries = driver.Manage().Logs.GetLog(LogType.Browser);
I got null object references in the Logs parameter.
My Chrome version is : 78.0.3904.108
Chrome driver version : 78.0.3904.105

Do you another solution?

Thanks,
Assaf.


בתאריך יום חמישי, 21 בנובמבר 2019 בשעה 22:01:52 UTC+2, מאת Oleksiy Kyrylenko:

Oleksiy Kyrylenko

unread,
Nov 26, 2019, 11:46:50 AM11/26/19
to Selenium Users
are you telling your driver to capture logs when you initiate it ?

אסף משעל

unread,
Nov 26, 2019, 2:22:33 PM11/26/19
to seleniu...@googlegroups.com
Yes,
I'm telling the driver to collect logs when I created it as you told me.


בתאריך יום ג׳, 26 בנוב׳ 2019, 18:47, מאת Oleksiy Kyrylenko ‏<oleksiykyryle...@gmail.com>:
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/_rRyAG3a3vY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/00fe1bf1-7f57-4f54-aa68-29e61170ed62%40googlegroups.com.

Tricia Crichton

unread,
Nov 26, 2019, 2:41:15 PM11/26/19
to Selenium Users
Unfortunately, this doesn't work in the C# bindings until version 4. See https://github.com/SeleniumHQ/selenium/issues/7390

You can find calls to console.log in the verbose ChromeDriver log, search for Runtime.consoleAPICalled. But I don't know any way to access them from your test code.
Reply all
Reply to author
Forward
0 new messages