I'm trying to follow the idea suggested in the Web Performance Testing with WebDriver google test automation conference talk and ChromeDriver "Performance Log" documentation page to get the trace data which I want to submit to webpagetest for performance analysis later.
How can I retrieve performance logs using python selenium bindings?
I've tried to print out log_types
available in the driver instance
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://stackoverflow.com')
print driver.log_types
driver.close()
but got only
[u'browser', u'driver']
And I don't see a relevant command-line switch.
Performance logs are disabled by default.
To enable it, use
DesiredCapabilities
and configureloggingPrefs
:This results into a bunch of tracing log entries printed on the console: