• Stars
    star
    148
  • Rank 242,189 (Top 5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OperaPrestoDriver is a vendor-supported WebDriver implementation that enables programmatic automation of Presto-based Opera products (i.e. v12 and older).

OperaPrestoDriver

OperaPrestoDriver is a vendor-supported WebDriver implementation developed by Opera and volunteers that enable programmatic automation of Presto-based Opera products (i.e. v12 and older). It is a part of the Selenium project.

Note that OperaPrestoDriver is only compatible with Presto-based Opera browsers up until v12.1*. For Blink-based Operas (v15 and onwards), refer to the OperaChromiumDriver project.

WebDriver is a general purpose library for automating web browsers. It can drive the browser running various tests on your web pages, just as if a real user was navigating through them. It can emulate actions like clicking links, enter text and submitting forms, and reporting results back to you so you know that your website works as intended.

OperaPrestoDriver's end-user emulation ensures that your entire stack (HTML, scripts, styling, embedded resources and backend setup) is functioning correctly without tedious manual testing routines.

OperaPrestoDriver is usable out of the box from the official Selenium packages, and can be used no extra setup on any Presto-based version of Opera.

Documentation

Getting started

To get set up, first download either the selenium-server-standalone or selenium-server package and make sure you have a fairly recent version of Opera installed in a default location. Finally, all you need to do is create a new OperaDriver instance:

WebDriver driver = new OperaDriver();
driver.get("http://opera.com/");

If you prefer using a package management system, OperaPrestoDriver is also available through Maven; either as a part of the Selenium package, or as a separate package. The group ID for Selenium is org.openqa.selenium.*, and com.opera and artifact ID operadriver for OperaPrestoDriver specifically.

Other languages

Since WebDriver provides bindings for several programming languages, you can follow the same approach as above in both Python (using the selenium package) and in Ruby (using the selenium-webdriver gem).

The Python equivalent of the above example would be:

from selenium import webdriver
driver = webdriver.Opera()
driver.get('http://opera.com/')

The same in Ruby:

require 'selenium-webdriver'
driver = Selenium::WebDriver.for :opera
driver.get('http://opera.com/')

To execute the tests, please ensure that the environmental variable SELENIUM_SERVER_JAR contains the path to the selenium-server-standalone JAR you downloaded earlier.

To execute the Python test:

SELENIUM_SERVER_JAR=/path/to/selenium-server-standalone.jar python test.py

And for Ruby:

SELENIUM_SERVER_JAR=/path/to/selenium-server-standalone.jar ruby test.rb

Running the server as a standalone process

OperaPrestoDriver is fully compatible with the RemoteWebDriver client. This allows you to run tests on a remote computer which is typically very useful in a distributed environment. First, ensure that your Selenium server is running, then create a remote client as usual:

WebDriver driver = new RemoteWebDriver("http://localhost:4444", DesiredCapabilities.opera());
driver.get("http://opera.com/");

Capabilities

To customize Opera and WebDriver in various ways you may request a certain configuration from the Selenium server. Since not all server implementations supports every WebDriver feature, the client and server should use JSON objects with the properties when describing which features are desirable.

In additon to the general WebDriver capabilities available, OperaPrestoDriver has a number of custom capabilities that may be requested. To request a specific driver configuration you

You can use the DesiredCapabilities class to request a specific driver configuration. The Opera-specific capabilities supported are:

Capability Type Default Description
opera.logging.level Level/String/Integer Level.INFO (String/Level/Integer) How verbose the logging should be. Available levels are: SEVERE (highest value), WARNING, INFO, CONFIG, FINE, FINER, FINEST (lowest value), ALL, OFF.

The argument may consist of either a level name as a string, an integer value, a Level reference, or null. If the value is neither of a known name nor an integer, an IllegalArgumentException will be thrown.
opera.logging.file File/String null Where to send the output of the logging. Default is to not write to file.
opera.product OperaProduct/String Desktop The product to request, for example OperaProduct#DESKTOP or OperaProduct#MOBILE. It will attempt to locate the product binary based on the operating system's default installation paths if opera.binary is not set.
opera.binary String Default location of Opera on system Path to the Opera binary to use. If not specified, OperaPrestoDriver will guess the path to your Opera installation (typically /usr/bin/opera, C:\Program Files\Opera\opera.exe, or similar).
opera.arguments String null Arguments to pass to Opera, separated by spaces. See opera -help for available command-line switches.
opera.emulationProfile EmulationProfile/JSON object null Allows you to specify an emulation profile to use with Opera Mobile.
opera.host String Non-loopback IP if available, loopback otherwise The host Opera should connect to. Since OperaPrestoDriver works in a client-server relationship to Opera (where Opera is the client, driver the server) you can also run remote instances of Opera on other devices; that be a phone, a TV or another computer.
opera.port Integer Random port The port to Opera should connect to. Setting this capability to 0 will probe for a free, random port, setting it to -1 will ensure compatibility mode using port the default port 7001 for Operas version 11.52 or older.
opera.profile OperaProfile/string temporary profile directory of the profile to use, or an OperaProfile instance object representing a profile. if null is given, a random temporary directory is used. if "", an empty string, then the default ~/.autotest profile directory will be used (for backwards compatibility with opera < 11.60).
opera.autostart Boolean true Whether to auto-start the Opera binary. If false, OperaPrestoDriver will wait for a connection from the browser. Go to "opera:debug", enter the correct host/port information, and hit Connect to connect manually.
opera.detach Boolean false Whether to detach the Opera browser when the driver shuts down. This will leave Opera running.
opera.display Integer null The X display to use. If set, Opera will be started on the specified display. (Only works on GNU/Linux.)
opera.idle Boolean false 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.
opera.runner String OperaLauncherRunner Allows you to specify which runner to use to control the Opera browser binary process.
opera.launcher String null Path to the launcher binary to use. The launcher is an external wrapper around the browser, and is used for controlling the binary and taking external screenshots. If left blank, OperaPrestoDriver will use a launcher supplied with the package.

OperaPrestoDriver also supports some of the common desired capabilities too:

Custom profile

For instance the OperaPrestoDriver can be made to start the browser with specific command-line arguments using the opera.arguments key. This key should define a list of a command-line arguments that should be passed to the browser on startup. For example, to start Opera with a custom profile:

DesiredCapabilities capabilities = DesiredCapabilities.opera();

OperaProfile profile = new OperaProfile("/path/to/profile");  // prepared profile
capabilities.setCapability("opera.profile", profile);

WebDriver driver = new OperaDriver(capabilities);

Opera Mobile Emulator

Or to tell the Opera Mobile Emulator to use the tablet UI and a specific screen resolution:

DesiredCapabilities capabilities = DesiredCapabilities.opera();

capabilities.setCapability("opera.product", OperaProduct.MOBILE);
capabilities.setCapability("opera.arguments", "-tabletui -displaysize 860x600");

WebDriver driver = new OperaDriver(capabilities);

Emulation profile

An emulation profile may be specified when interacting with Opera Mobile to instruct the emulator to use a certain configuration. You may either give it an instance of OperaMobileEmulation which transparently deserializes into a JSON object, or a JSON object directly:

{
  profileName: "foo",
  width: 800,
  height: 600,
  ppi: 230,
  ime: "tablet",
  userAgent: "Android"
}

Logging and X display

Similarly, to increase the logging verbosity and, for GNU/Linux, ask Opera to start on a different X display:

DesiredCapabilities capabilities = DesiredCapabilities.opera();

capabilities.setCapability("opera.logging.level", Level.CONFIG);
capabilities.setCapability("opera.logging.file", "/var/log/operadriver.log");
capabilities.setCapability("opera.display", 8);

WebDriver driver = new OperaDriver(capabilities);

Proxy

It is also possible to configure a proxy for use with Opera. The proxy configuration is set through the capabilities. You can use the Proxy helper in Selenium to manage it:

DesiredCapabilities capabilities = DesiredCapabilities.opera();

Proxy proxy = new Proxy();
proxy.setHttpProxy("127.0.0.1:1234");
capabilities.setCapability("proxy", proxy);

WebDriver driver = new OperaDriver(capabilities);

Environment variables

To specify a custom location of the Opera binary and the command-line arguments to use, you may also use environmental variables. These are the available variables:

Name Description
OPERA_PATH The absolute path to the Opera binary you want to use. If not set OperaPrestoDriver will try to locate an Opera (desktop or mobile) on your system.
OPERA_ARGS A space-delimited list of arguments to pass on to Opera, e.g. -nowindow, -dimensions 1600x1200, &c. See opera -help or operamobile -help to see available arguments.

To set environment variables:

  • GNU/Linux and Mac: export OPERA_PATH=..., and add this line to ~/.bashrc (or your shell's configuration file) to use in all future sessions.
  • Windows: Please follow this guide: http://support.microsoft.com/kb/310519

Supported Opera versions

Desktop

This is a list of the official Opera Desktop versions supported by OperaPrestoDriver. Please note that this Java version of OperaPrestoDriver does not support Chromium-based Opera v15+ β€” for that, refer to the OperaChromiumDriver project.

Version Workaround/tweaks needed
12.16
12.15
12.14
12.13
12.12
12.10
12.01
12.00
11.64
11.62
11.61
11.60
11.52 Set opera.port to -1 and opera.profile to "" (empty string) to disable -debugproxy and -pd command-line arguments
11.51
11.50
11.11
11.10
11.01 -autotestmode command-line argument is not supported, use a wrapper script
11.00

Mobile

Please use one of the prepared builds to use OperaPrestoDriver with Opera Mobile.

OperaPrestoDriver does not support the Chromium-based Opera Mobile builds.

Wrapper script

Some Opera versions don't support the -autotestmode, -debugproxy or -pd arguments sent by OperaPrestoDriver by default. You can bypass this problem by creating a wrapper script like this and pointing the capability opera.binary to its absolute path:

#!/bin/sh
# Wrapper to prevent the -autotestmode argument reaching this version of Opera
# which doesn't support it.
`dirname $0`/opera

Development

While OperaPrestoDriver is officially maintained by Opera, it is free software and would only be possible thanks to many volunteer contributors. If you come across a reproducible bug, please open an issue to submit a bug report.

Even better, you can send a pull request! Any changes you make must follow the Google Coding Standards and have test cases attached to them if you introduce a new feature.

Much of OperaPrestoDriver’s code is shared with the other WebDriver implementations, and for working on this code base you should also familiarize yourself with the Selenium code base. There are also a few tips available for working on Selenium.

Support

If you have problems or questions regarding OperaPrestoDriver or Selenium, there are many channels in which you can seek help:

  • IRC: The #selenium channel on the irc.freenode.org network
  • Mailing lists: The webdriver or selenium-users mailing list

More Repositories

1

ssh-key-authority

A tool for managing SSH key access to any number of servers.
PHP
441
star
2

dns-ui

Opera's LDAP-authenticated PowerDNS user interface
PHP
277
star
3

Emberwind

HTML5 port of the indie platform game Emberwind.
JavaScript
261
star
4

operachromiumdriver

OperaDriver for Chromium-based Opera releases
250
star
5

dragonfly

Opera Dragonfly is a fully featured development and debugging tool integrated into the Opera browser.
JavaScript
159
star
6

chrome-webstore-extension

Contains the code of the Download Chrome Extension hosted at https://addons.opera.com which allows users to install extensions from Google Chrome Web Store directly in Opera browser
JavaScript
97
star
7

devopera

Repository for Dev.Opera source code
HTML
90
star
8

Odin

A WebGL framework
JavaScript
81
star
9

devopera-static-backup

Static backup for the Dev.Opera site as it was in February 2014.
JavaScript
63
star
10

operawatir

Easily and automatically test your web pages just like a user would. OperaWatir simulates a user clicking links, entering text and submitting forms, reporting results back so you know that your website works.
Ruby
45
star
11

presto-testo

Opera's Presto test suite as it applies to W3C specifications
HTML
40
star
12

jsunzip

A JavaScript port of JΓΈrgen Ibsens "tiny inflate library" and some additional code for reading a zip archive. All available under the zlib/libpng license.
JavaScript
39
star
13

bb8

A BB-8 controller built with web standards. Web Bluetooth API demo.
JavaScript
37
star
14

sentrycli

CLI tools to query and analyze data gathered by Sentry
Python
36
star
15

django-feeds

Django feeds provides an extensive database model for RSS feeds and a fault tolerant parser.
Python
30
star
16

logo

Opera Logo
HTML
29
star
17

git-splitter

A Git related tool to split a subdirectory and its commit history from a Git Repo and crate a new repo that can be used as a submodule in the same path as the original code, as well as reversing the process to allow reintegration of updated code
Python
27
star
18

toolkit

Opera Web UI Toolkit
JavaScript
26
star
19

TextureAtlas

A simple script to generate texture atlases.
Python
25
star
20

desktop

Repository of LGPL packages for Opera Desktop Browser
JavaScript
24
star
21

upstreamtools

Showing upstreamed patches from Opera
Python
23
star
22

operaextensions.js

Opera (.oex) Extensions JavaScript API Compatibility Layer for Chromium-based Opera 15+ (.nex) Extensions
JavaScript
17
star
23

dragonkeeper

A standalone proxy to support Opera Dragonfly development. Dragonkeeper translates STP (Scope Transport Protocol) to HTTP.
Python
16
star
24

AndroidNotes

Sample Android application to manage notes using the Opera Link API
Java
15
star
25

oex2nex

Standalone tool to convert an Opera (.oex) extension into an Opera 15+ (.nex) extension
JavaScript
15
star
26

tlsprober

Main repo for the TLS Prober project. Scans TLS Servers and registers feature information and compliance in a database
Python
14
star
27

chromevox

Chromevox only export of Chrome accessibility suite (https://code.google.com/p/google-axs-chrome/).
JavaScript
11
star
28

widgets-libraries

A handful of Opera Widgets utility libraries for use in Widget development.
JavaScript
11
star
29

xmarks-importer

Simple Xmarks importer for Opera Link, using the Opera Link API
Python
10
star
30

twisted-apns

Twisted client for Apple Push Notification Service (APNs)
Python
10
star
31

unite-libraries

Documentation of the core Opera Unite API and a handful of additional helper libraries. Please note that since April 2012 Opera Unite is no longer being developed or supported.
JavaScript
10
star
32

dragonfly-build-tools

Python
9
star
33

gn-opera

A fork of https://gn.googlesource.com/gn/ initially created to add Jumbo build mechanism with the support for Visual Studio projects.
C++
9
star
34

AndroidOperaLink

OBSOLETE Java library to access the Opera Link API. PLEASE USE https://github.com/operasoftware/JavaOperaLinkClient INSTEAD
Java
9
star
35

tlslite

Modified version of Public Domain TLSLite library. Extended and instrumented to handle TLS 1.2, extensions, and performing various tests of TLS Server compliance
Python
8
star
36

uwsgi-pypy-python3

PyPy Python 3 support for uwsgi
Python
8
star
37

javascript-styleguide

Opera Software Javascript Styleguide
7
star
38

tlscommon

The engine of the TLS Prober. Scans a given TLS Server, registering features and compliance. Also used by the TLS Web Prober. Uses a modified TLS Lite implementation as a TLS Protocol implementation.
Python
7
star
39

AI-Classifier

Perl
7
star
40

rollercoaster

A simple site featuring good tablet-optimized site concepts and design patterns
CSS
6
star
41

gstreamer

gstreamer modified by Opera Software
C
6
star
42

dragonfly-documentation

Documentation for Opera Dragonfly
6
star
43

graphite-cleaner

Graphite Whisper stale database files remover
Python
5
star
44

dragonfly-manual-test-suite

JavaScript
5
star
45

fake-store

Fake web store β€” a Payment Request API demo
JavaScript
5
star
46

photo-tagger

JavaScript
5
star
47

perl5-net-operalink

Net::OperaLink, Perl interface to the Opera Link API
Perl
5
star
48

AI-NaiveBayes

Perl
5
star
49

Device-Stock-UA-RFC

A draft of the Device-Stock-UA request header.
4
star
50

Widgets-Plugin-for-Eclipse

Java
4
star
51

mpns-client

Microsoft Push Notification Service client
Python
4
star
52

live-news-feed

Opera Live News Feed extension
4
star
53

twisted-gcmclient

Twisted client for Google Cloud Messaging (GCM)
Python
4
star
54

portal

portal.opera.com extension
JavaScript
4
star
55

arepa

Apt REPository Assistant, a web application + command-line utilities to manage Debian package repositories
Perl
4
star
56

check_rabbitmq_queues

Nagios plugin written in python for checking if queue lengths do not exceed thresholds specified in config
Python
4
star
57

tlswebprober

Main repo for the TLS Web Prober project. Adjunct to, and used for testing of the TLS Prober project. Performs a scan of a given TLS Server, name entered in a form, and presents the result as a HTML page
Python
4
star
58

Do-it-Yourself---Dependency-Injection--Perl-

This is a Perl port of the original Java code from "Do it Yourself – Dependency Injection" by Chad Parry
Perl
4
star
59

php-myopera

PHP library to use the My Opera Community API
PHP
3
star
60

appearin-pop

Repository for the Appear.in Pop extension
JavaScript
3
star
61

scope-interface

Documentation of the Opera Scope interface
3
star
62

perl5-net-myopera

Net::MyOpera, Perl interface to the My Opera Community API
Perl
3
star
63

bragi

Bragi: JavaScript like Poetry
JavaScript
2
star
64

docker-registry-image

Dockerfile
2
star
65

touch

Java
2
star
66

appearin-social

Repository for the Appear.in Social extension
JavaScript
2
star
67

ted-ideas-worth-spreading

JavaScript
2
star
68

Text-WordCounter

counting words in multilingual texts
Perl
2
star
69

telestatsd

StatsD client in Python with support for Telegraf and SRV records in DNS
Python
2
star
70

Courriel--MMS

Courriel extension for dealing with MMSes forwarded as emails
Perl
2
star
71

pyoperalink-article-code

Code for the pyoperalink library article
Python
2
star
72

operavox

Talkback and Brailleback helpers for Opera Devices SDK for Android based on Chromevox.
JavaScript
2
star
73

Imager-GIF

a handy module for animated GIF processing
Perl
1
star
74

viewport-compliance-test

JavaScript
1
star
75

trade-doubler

JavaScript
1
star
76

watir3-spec

Proposal for Watir 3 API
Ruby
1
star
77

wmue

World’s most useless extension
1
star
78

nettle-wycheproof-testsuite

This project (also known as PikeProof) aims to test the resilience/correctness of the Pike programming language's (and the Nettle cryptographic library's) cryptographic functions against the Wycheproof testsuite. It should run on (at least) Pike versions 8.0 and 8.1.
Pike
1
star