Skip to content
This repository has been archived by the owner on Nov 18, 2019. It is now read-only.

Selenium C# Logging Preferences incompletely implemented? #189

Closed
axtens opened this issue Jun 28, 2018 · 3 comments
Closed

Selenium C# Logging Preferences incompletely implemented? #189

axtens opened this issue Jun 28, 2018 · 3 comments

Comments

@axtens
Copy link

axtens commented Jun 28, 2018

(Based on the original on StackOverflow)
I am using Selenium.WebDriver.Chrome 2.40.0

According to the documentation the following is allowed

var co = new ChromeOptions();
co.SetLoggingPreference(LogType.Browser, LogLevel.All);
co.SetLoggingPreference(LogType.Client, LogLevel.All);
co.SetLoggingPreference(LogType.Driver, LogLevel.All);
co.SetLoggingPreference(LogType.Profiler, LogLevel.All);
co.SetLoggingPreference(LogType.Server, LogLevel.All);

However, when I actually try to access the Client, Server and Profiler logs I get (on stderr)

Starting ChromeDriver 2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb) on port 56426
Only local connections are allowed.
[1529414019.263][WARNING]: Ignoring unrecognized log type: client
[1529414019.266][WARNING]: Ignoring unrecognized log type: profiler
[1529414019.266][WARNING]: Ignoring unrecognized log type: server

Having access to these three log objects would be helpful. How do I access them, if at all?

Extra Detail

According to the documentation about LogType, there are 5 possible values: Browser, Client, Driver, Profiler and Server.

I don't understand why the documentation says there are five, but operationally there's only Browser and Driver.

@lmtierney
Copy link
Member

lmtierney commented Jun 28, 2018

Those listed are only the possible log types. For instance, server will only be available if you're using a server that implements this log (such as selenium-server). You can see which log types are available from your endpoint by using the GetAvailableLogTypes method

http://seleniumhq.github.io/selenium/docs/api/dotnet/html/F_OpenQA_Selenium_Remote_DriverCommand_GetAvailableLogTypes.htm

@lmtierney
Copy link
Member

In the future, please send questions to the selenium user group.

@fractalocity
Copy link

fractalocity commented Sep 26, 2019

GetAvailableLogTypes is not useful. Outdated solution. (Selenium 3.141)
the suggested solution only returns the string 'getAvailableLogTypes'

var availableLogTypes = OpenQA.Selenium.Remote.DriverCommand.GetAvailableLogTypes;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants