OperaDriver 0.11 was released this afternoon and will be a part of Selenium 2.21 scheduled soon. The test setup has undergone a massive refactoring to support in-process web application servers so we can simulate real-world conditions in the tests, the Scope protocols are now being generated using hob (from the Dev Tools team), and some further methods have been deprecated in the API to match the reality of the WebDriver API.
The API changes are as follows:
OperaTimeouts.responseTimeout()for customizing the response timeout interval. The response timeout specifies how long to wait before closing the TCP connection to Opera if it does not reply.
OPERA_HOSTenvironmental variable for connecting from an Opera instance on another device, e.g. a mobile phone.
OperaWebElement.click(int x, int y)and
Another noteworthy new feature is the ability to clear private data from the
browser's cache. The available types of data to delete can be found in the
OperaDriver.PrivateData: Visited links, disk cache, image
cache, memory cache, sensitive data, session cookies, all cookies, global
history, console, thumbnails, web databases, web storage, appcache, geolocation
permissions, and site prefs.
This is an example of how you can clear the memory and image caches:
OperaDriver driver = new OperaDriver(); driver.utils().clearPrivateData(OperaDriver.PrivateData.IMAGE_CACHE, OperaDriver.PrivateData.MEMORY_CACHE);
OperaProfile class introduced in version 0.9 now has an
toJson() method which will allow you to use and
manipulate profiles across the Json Wire
Protocol as well, for instance when using OperaDriver as RemoteWebDriver.
You typically do this when testing with Opera from another language
The preferences system has gotten an overhaul and we are now relying more on the data types specified by Opera than our own heuristic. This has both upsides and downsides, but all in all it will make the available data types for prefs in Java correspond better with the ones in Opera.
The README can be found here: https://github.com/operasoftware/operadriver/blob/v0.11/README.md
If using Maven, OperaDriver is available in the group com.opera under the artifact ID operadriver.
You may download the OperaDriver JAR separately here: https://github.com/downloads/operasoftware/operadriver/operadriver-v0.11.zip
The API documentation has been updated and can be found here: http://operasoftware.github.com/operadriver/docs/
This is the full changelog:
v0.11 (2012-03-05) [API CHANGES] * Introducing OperaTimeouts.responseTimeout() for customizing the response timeout interval. (andreastt) * Removed opera.guess_binary_path capability. (andreastt) * Recognizing opera.launcher capability. (andreastt) * Deprecated OperaWebElement.click(int times), click(int x, int y) and middleClick(). (andreastt) [NEW FEATURES] * Using new extension to hob, javagen, for generating Java classes from Scope protocols. (andreastt) * Support for clearing private data. (danielb/andreastt) [ENHANCEMENTS] * Upgraded to Selenium 2.20. (andreastt) * Raising response timeout to 60 seconds. (andreastt) * Improved reliability of implicit waits. (andreastt) * OperaProfile.toJson() now returns a proper JSON representation of the profile. (andreastt) * Now relying more on the data types given by Opera for preferences. (andreastt) * Functionality for converting OperaDriver settings to capabilities. (andreastt) * Delegated more responsibilities during initialization to OperaRunnerSettings. (andreastt) [BUG FIXES] * OperaArguments.merge() will now return a reference to it self. (andreastt) * OperaRunnerSettings.setBinary() now accepts java.io.File as the default argument. (andreastt) * If ENABLE_CHECKS is enabled, this is no longer applied to asserting whether elements are displayed or not. (andreastt) * Recompiled ecmascript service protocols to facilitate CORE-36517, fixes SPARTAN-1165. (andreastt) * Facilitate connecting to a remote host, addresses OPDRV-152. (andreastt) * Removed desktop-specific hardcoded response timeout to 30 seconds when a window is loaded. (andreastt) * Remove a redundant cast. (hansd) * AbstractEventHandler turned into an interface, and EventHandler into an actual abstract class. Fixes inconsistencies. (andreastt) * Renamed AbstractEventHandler to ScopeEventHandler (implementation) and removed STP/0 support. (andreastt) * Unspecified type for field shuttingDown in ScopeServices. (andreastt) * Removed temporary fix for CORE-33057. (andreastt) * We were not respecting implicit waits, removing unused EXEC_SLEEP workaround. (andreastt) [TESTS] * Major refactoring of test setup. (andreastt) * Introducing annotation FreshDriver for forcing a driver restart. (andreastt) * In-process web server for tests (much like Selenium's). (andreastt) * Introduced OperaDriverBuilder and various OperaDriverSuppliers for use in SpartanRunner and for testing. (andreastt) * Added methods toString() and toList() to OperaIntervals for debugging purposes. (andreastt) * Added test for specifying launcher from capabilities. (andreastt) [OTHER] * Protocol files no longer have version numbers in filenames, resolves OPDRV-154. (andreastt) * Printing warnings when compiling OperaDriver. (hansd) * Removed old getting started examples, relocated remote example. (andreastt) * Various fixes for documentation. (andreastt)