Capabilities in OperaDriver

We recently added Capabilities support for OperaDriver. This will allow you to use the OperaDriver implementation with Remote WebDriver, the client that allows you to hook up to a “hub” or “server” managing your actual browser instance.

It also enables you to use other language bindings, such as Ruby and Python, with Opera. Since OperaDriver is written natively in Java, we don't replicate any of the code logic in other languages, but instead forward the command calls directly to the Java implementation.

Jari Bakken has written an outstanding gem called selenium-webdriver which works great with OperaDriver. I'm working on adding proper support for Python and Perl.

From Java however, it's quite easy to use:

DesiredCapabilities capabilities = new DesiredCapabilities.opera();
capabilities.setCapability("opera.binary", "/path/to/your/opera");
capabilities.setCapability("opera.log.level", "CONFIG");
WebDriver driver = new OperaDriver(capabilities);

The available settings are:

(String) How verbose the logging should be. Available levels are: SEVERE (highest value), WARNING, INFO, CONFIG, FINE, FINER, FINEST (lowest value), ALL. Default is INFO.
(String) Where to send the output of the logging. Default is to not write to file.
(String) Path to the Opera binary to use. If not specified, OperaDriver will guess the path to your Opera installation (typically /usr/bin/opera or C:\Program Files\Opera\opera.exe).
(String) The host Opera should connect to. Unless you're starting Opera manually you won't need this.
(Integer) The port to Opera should connect to. 0 = Random, -1 = Opera default (for use with Opera > 12).
(String) Path to the launcher binary to use. The launcher is a gateway between OperaDriver and the Opera browser, and is being used for controlling the binary and taking external screenshots. If left blank, OperaDriver will use the launcher supplied with the package.
(String) Arguments to pass to Opera, separated by spaces. See opera -help for available command-line switches.
(String) Directory to use for the Opera profile. If null a random temporary directory is used. If "", an empty string, then the default autotest profile directory is used.
(Boolean) Whether to use Opera's alternative implicit wait implementation. It will use an in-browser heuristic to guess when a page has finished loading, allowing us with great accuracy tell whether there are any planned events in the document. This functionality is useful for very simple test cases, but not designed for real-world testing. It is disabled by default.
(Integer) The X display to use. (Only works on UNIX-like OSes.)
(Boolean) Whether to auto-start the Opera binary. If false, OperaDriver will wait for a connection from the browser. Go to "opera:debug", enter the correct port number, and hit "Connect" to connect manually.
(Boolean) Whether to restart.
(Boolean) Whether to quit Opera when OperaDriver is shut down. If enabled, it will keep the browser running after the driver is shut down.
(Boolean) Whether to guess the path to Opera if it isn't set in opera.binary.
(String) The profile configuration we are using, for example "desktop" or "core-gogi".

Note that the Capabilities object completely replace the old OperaDriverSettings object, which has now been deprecated. We will keep the support for OperaDriverSettings in until v0.7.4 or v0.8.