Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception "unrecognized performance logging option: enableTimeline" when setting options using latest chromedriver #5481

Closed
eliav-raviv opened this issue Feb 11, 2018 · 3 comments

Comments

@eliav-raviv
Copy link

OS:
Windows 7
Selenium Version:
3.8.0
Browser:
Chrome
Browser Version:
63.0.3239.132
ChromeDriver version:
2.35.528161

We are initializing ChromeDriver with options as follows:

var option = new ChromeOptions();
var perfLogPrefs = new ChromePerformanceLoggingPreferences();
perfLogPrefs.AddTracingCategories("performance");
                            
perfLogPrefs.IsCollectingNetworkEvents = true;
perfLogPrefs.IsCollectingPageEvents = true;
perfLogPrefs.BufferUsageReportingInterval = TimeSpan.FromMilliseconds(1000);
option.AddArgument("--off-screen-rendering-enabled");
option.AddArgument("--disable-accelerated-compositing");
option.AddArgument("--disable-extensions");
option.AddArgument("--test-type");
option.AddArgument("--disable-plugins-discovery");
option.AddArgument("--disable-bundled-ppapi-flash");
option.AddArgument("--disable-popup-blocking");
option.AddArgument("--no-sandbox");
option.AddArgument("--enable-logging --v=1");
option.AddArgument("--vmodule=metrics=2");                            

option.AddUserProfilePreference("profile.default_content_setting_values.automatic_downloads", 1);
option.PerformanceLoggingPreferences = perfLogPrefs;
option.AddAdditionalCapability(CapabilityType.EnableProfiling, true, true);
option.SetLoggingPreference(LogType.Profiler, LogLevel.All);
option.SetLoggingPreference(LogType.Browser, LogLevel.All);
option.SetLoggingPreference(LogType.Client, LogLevel.All);
option.SetLoggingPreference(LogType.Driver, LogLevel.All);
option.SetLoggingPreference(LogType.Server, LogLevel.All);
option.SetLoggingPreference("performance", LogLevel.All);

ChromeDriverService driverService = ChromeDriverService.CreateDefaultService(binariesLocation);
driverService.HideCommandPromptWindow = true;
                            
_currentDriver = new ChromeDriver(driverService, option);

On every run, the ChromeDriver constructor throws the following exception:

Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options)
at AutomationFramework.Drivers.Selenium.SeleniumDriver.SetDriver(BrowserType browser, String debugPort) in d:\I4\Main\GfnApps\Automation\Drivers\Selenium\SeleniumDriver.cs:line 332
at AutomationFramework.Drivers.Selenium.SeleniumDriver..ctor(BrowserType browserType, String portNumber) in d:\I4\Main\GfnApps\Automation\Drivers\Selenium\SeleniumDriver.cs:line 69
at AutomationFramework.TestLogic.CI.Tests.IdSbaseTestClass.SetDefaultDriver(BrowserType browserType) in d:\I4\Main\GfnApps\Automation\TestLayer\CI\Tests\IDSbaseTestClass.cs:line 708
at AutomationFramework.TestLogic.CI.Tests.IdSbaseTestClass.DriverSetTheDrivers(Boolean forceKill) in d:\I4\Main\GfnApps\Automation\TestLayer\CI\Tests\IDSbaseTestClass.cs:line 719
at AutomationFramework.TestLogic.CI.Tests.IdSbaseTestClass.BeforeTestSetup(Boolean switchTo3D, String studyUid, String studyName, ClientRunMode clientRunMode, String studyDescription, Boolean closeMb, Boolean isMoviePlay, Boolean closeAllTabs, String isiteUserName, String isiteUserPass, Boolean forceKillForSaveFindings, Boolean setDualMonitor, Boolean logOutUserAfterTest, Boolean withoutTest, Boolean openIsiteOnly, Boolean closeAllTabsByShortcut) in d:\I4\Main\GfnApps\Automation\TestLayer\CI\Tests\IDSbaseTestClass.cs:line 147
at AutomationFramework.TestLogic.CI.Tests.Test2DLayout.Test2DWindowingAndSwivelOnSlab() in d:\I4\Main\GfnApps\Automation\TestLayer\CI\Tests\Test2DLayout.cs:line 147
Result Message:
Test method AutomationFramework.TestLogic.CI.Tests.Test2DLayout.Test2DWindowingAndSwivelOnSlab threw exception:
System.InvalidOperationException: unknown error: cannot parse capability: goog:chromeOptions
from unknown error: cannot parse perfLoggingPrefs
from unknown error: unrecognized performance logging option: enableTimeline

Issue is caused by method:
OpenQA.Selenium.Chrome.ChromeOptions.GeneratePerformanceLoggingPreferencesDictionary()
Which initializes a logging option entry named 'enableTimeline'. This option is not recognized by newer versions of ChromeDriver (2.21 and up AFAIK, could be even earlier), causing the exception to be thrown.

@jimevans
Copy link
Member

Given that the official ChromeDriver documentation shows that is valid, can you help me understand what the proper JSON payload should be? Should the enableTimeline option just never be set at all now? Can you point me to the release notes for ChromeDriver where support for that option was dropped?

@eliav-raviv
Copy link
Author

eliav-raviv commented Feb 11, 2018

This area is not very well documented, and I can't find sources I had about the version the timeline change was made...
Take a look at this chromium bug report: https://bugs.chromium.org/p/chromedriver/issues/detail?id=2034 - (fairly recent, includes payload example) the dev states that timeline events are deprecated and recommends not sending enableTimeline in the payload to resolve the issue.

EDIT: another similar bug report stating that timeline is no longer available: https://groups.google.com/forum/#!topic/chromedriver-users/132rOz35-gs

jimevans added a commit that referenced this issue Feb 11, 2018
…river

According to chromedriver bug #2034
(https://bugs.chromium.org/p/chromedriver/issues/detail?id=2034),
the enableTimeline performance logging preference is no longer accespted
by chromedriver.exe. The .NET language bindings will no longer send that
preference to the driver executable. Additionally, the peroperty setting
the preference has been deprecated, and will generate a compile-time
warning. The property will be remvoed in a future release. Fixes
issue #5481.
@jimevans
Copy link
Member

Fixed in commit b1a7d4d.

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
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

2 participants