OS: Windows 7
Selenium Version: 2.53.0 .net
Browser: Google Chrome
Browser Version: 49.0.2623.87 (64 bits)
Start Chrome driver using the option "PerformanceLoggingPreferences" to collect events from Network domain
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 ?
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 !.
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);`
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)
Most helpful comment
Was this answer tested? When I do copy the code above I do get this exception.