-
Notifications
You must be signed in to change notification settings - Fork 59
Logging
nataliakoval edited this page Feb 12, 2015
·
9 revisions
QtWebdriver supports the browser
and driver
log types as defined here: https://code.google.com/p/selenium/wiki/JsonWireProtocol#Log_Type.
-
driver
: captures the WebDriver logs. -
performance
: capture the Performance logs. Disabled by default. -
browser
: captures output of the javascript console.
For thebrowser
log type, the log levels are mapped to Javascript console methods as follows:
Log Level | Javascript Console |
---|---|
INFO | console.log |
WARNING | console.warn |
SEVERE | console.error |
Logs can be activated like this:
Java
DesiredCapabilities capability = DesiredCapabilities.qtwebkit();
LoggingPreferences logs = new LoggingPreferences();
Level level = Level.ALL;
logs.enable(LogType.DRIVER, level);
logs.enable(LogType.BROWSER, level);
logs.enable(LogType.PERFORMANCE, level);
capability.setCapability(CapabilityType.LOGGING_PREFS, logs);
driver = new RemoteWebDriver(new URL(hubURL), capability);
You can get performance log entries as below. See the WebDriver logging documentation for more information.
for (LogEntry entry : driver.manage().logs().get(LogType.PERFORMANCE)) {
System.out.println(entry.toString());
}
Python
CAPS = {
"browserName": "qtwebkit",
"version": "",
"platform": "ANY",
"javascriptEnabled": True,
"loggingPref": {
"driver":"ALL",
/* etc...*/
}
}
self.selenium = webdriver.Chrome(desired_capabilities=CAPS)
Home | Build And Run | Releases | Features
Copyright © 1992-2016 Cisco and/or its affiliates