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

How to launch chrome with performance logging .net #1844

Closed
nessou opened this issue Mar 18, 2016 · 2 comments
Closed

How to launch chrome with performance logging .net #1844

nessou opened this issue Mar 18, 2016 · 2 comments
Labels

Comments

@nessou
Copy link

nessou commented Mar 18, 2016

Meta -

OS: Windows 7
Selenium Version: 2.53.0 .net
Browser: Google Chrome
Browser Version: 49.0.2623.87 (64 bits)

Expected Behavior -

Start Chrome driver using the option "PerformanceLoggingPreferences" to collect events from Network domain

Actual Behavior -

I am trying to launch Chrome using the option "PerformanceLoggingPreferences" but i got this error :
unknown error: perfLoggingPrefs specified, but performance logging was not enabled

Did i forgot something ? I can't find any examples with Chrome performance in .net.
This is a only way to collect network event in Chrome with webdriver ?

Steps to reproduce -

ChromePerformanceLoggingPreferences perfLogPrefs = new ChromePerformanceLoggingPreferences();
ChromeOptions options = new ChromeOptions();
perfLogPrefs.AddTracingCategories(new string[] { "devtools.timeline" });
options.PerformanceLoggingPreferences = perfLogPrefs;
options.AddAdditionalCapability(CapabilityType.EnableProfiling, true, true);
IWebDriver driver = new ChromeDriver(options);`

Thank you !.

@jimevans
Copy link
Member

Your code is incomplete. As shown in the performance enhancement example for ChromeDriver, you need to enable specific logging preferences for performance. Your code should look like the following:

ChromePerformanceLoggingPreferences perfLogPrefs = new ChromePerformanceLoggingPreferences();
perfLogPrefs.AddTracingCategories(new string[] { "devtools.timeline" });

ChromeOptions options = new ChromeOptions();
options.PerformanceLoggingPreferences = perfLogPrefs;
// Note there is not yet a constant for "performance" as there is for other
// log types (e.g. LogType.Client), since Chrome is the only implementer
// for "performance".
options.SetLoggingPreference("performance", LogLevel.All);
IWebDriver driver = new ChromeDriver(options);`

@jhornych
Copy link

jhornych commented Feb 4, 2018

Was this answer tested? When I do copy the code above I do get this exception.

unknown error: cannot parse capability: goog:chromeOptions
from unknown error: cannot parse perfLoggingPrefs
from unknown error: unrecognized performance logging option: enableTimeline
(Driver info: chromedriver=2.35.528161,
platform=Windows NT 10.0.16299 x86_64)

@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
Projects
None yet
Development

No branches or pull requests

4 participants