Giter Club home page Giter Club logo

operaprestodriver's Introduction

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

operaprestodriver's People

Contributors

ajayk avatar alex-savchuk avatar andreasbovens avatar andreastt avatar arnsholt avatar barancev avatar illicitonion avatar jvkrey avatar mathiasbynens avatar mexicano avatar michaeltamm avatar mlech avatar rjatkins avatar rob--w avatar stuk avatar takahah avatar zitrax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

operaprestodriver's Issues

Problem selecting WebElements with XPath (works with FF)

Hi,
i am having problem with getting WebElements using XPath. The XPath expression works fine with firefox,
however it fails with Opera and returns just nothing. The expression is:

//select[@id='stammdatenForm:userTypeInput']/option

final List elements = driver.findElementsByXPath(xpathExpression);

Basic question: is the findElementsByXPath already implemented in the opera driver?
If you need more information about the html page causing the problem, please tell me.

cheers,
Andy

OperaDriver tries to extract launcher binaries from wrong resource path in OperaLaunchers JAR

In OperaLauncherRunnerSettings, OperaDriver 0.8.1 (downloaded from Maven) tries to extract launcher binaries from the OperaLaunchers JAR. But it tries to extract them from a non-existent "launchers" directory inside the JAR.

    URL
        sourceLauncher =
        OperaLaunchers.class.getClassLoader().getResource("launchers/" + launcherName);

I believe this line would resolve correctly:

OperaLaunchers.class.getClassLoader().getResource(launcherName);

It appears that when built with Ant, OperaDriver builds the launchers into the OperaDriver JAR itself.

Does this problem reflect a difference between the ZIP and Maven packaging?

Slow-loading inline javascript causes No response in a timely fashion exception, regardless of page loading timeout

If javascript causes a page load to take a long time, regardless of the page load timeout, a ResponseNotReceivedException will be thrown.

If the slow-loading javascript was document.write'n to the page, the get will throw during the nested switch to defaultContent.
If the slow-loading javascript is just inline in the page, the get will return cleanly, but the following command will throw.

Test cases:

WebDriver driver = new OperaDriver();
driver.get("http://illicitonion.com/sebugs/operadriver-timely1/index.html");
assertEquals("Page", driver.getTitle());

WebDriver driver = new OperaDriver();
driver.get("http://illicitonion.com/sebugs/operadriver-timely2/index.html");
assertEquals("Page", driver.getTitle());

Source of example pages is available at http://illicitonion.com/sebugs/operadriver-timely.tar - I can't work out a way to attach files to this issue, I guess you're meant to use a pull request or gist or something...

If your computer is more powerful than mine, you may need to add a few extra zeros to the hard-coded powers of 10 :)

new OperaSettings() leads to NPE on windows 7 64 bit with 32 bit IBM JDK6

Hi,

When using opera driver 0.13/0.14, the invocation to new OperaSettings() lead to NPE:

Exception in thread "main" java.lang.NullPointerException
at java.io.File.(File.java:233)
at com.opera.core.systems.OperaSettings$Capability$3.getDefaultValue(OperaSettings.java:155)
at com.opera.core.systems.OperaSettings$Capability$3.getDefaultValue(OperaSettings.java:153)
at com.opera.core.systems.OperaSettings$CapabilityInstance.(OperaSettings.java:534)
at com.opera.core.systems.OperaSettings.(OperaSettings.java:572)

The opera installation is in "C:\Program Files\Opera\opera.exe" however the 32 bit IBM JDK System.getenv("ProgramFiles(x86)") does return C:\Program Files (x86) which leads OperaPaths.operaPath() to search for for opera in a wrong location.

In addition, it may be possible for a windows 64 bit user to install an opera 32 bit browser(I have not confirm this). It may be safer for the opera driver to search for the opera installation in both Program File/Program Files (x86) locations.

Opera Launcher on Windows 7

Having trouble getting Opera to launch from Examples. Had to manually add Opera environment vars in windows 7 for OPERA_PATH and OPERA_LAUNCHER and still had to hardcode the path to the binary launcher in OperaPaths.java and recompile. Once I got past these issues, I've been stuck on getting it to launch the latest version of Opera 11.11 that I just installed two days ago. I set the "Proxy Auto Connect" to on in the Developer config and Opera gives me no issues launching directly.

When I run the Example class, I get the message:

"Opera has failed to access or upgrade your profile. This may have occurred because your computer has insufficient resources available or because some files are locked by other applications. You may have to restart your computer before Opera will start again."

I've tried allowing "Everyone" full access in to both the operaprefs.ini and the operadefaultprefs.ini and at this point am at a loss as to what to do next.

Not sure if this is a bug as I see an issue that someone else had on Windows 7 was corrected once he downloaded the executable correctly. Any assistance is appreciated.

Thanks,

Luke

Using Windows 7, 64-bit and Java 1.6.24

org.openqa.selenium.WebDriverException: com.opera.core.systems.scope.exceptions.ResponseNotReceivedException: No response in a timely fashion

Hello,

We are getting the following exception when we run our Selenium tests on Windows:

org.openqa.selenium.WebDriverException: com.opera.core.systems.scope.exceptions.ResponseNotReceivedException: No response in a timely fashion
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 12:59:39'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_02'
Driver info: driver.version: OperaDriver
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 12:59:39'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_02'
Driver info: driver.version: OperaDriver
at com.opera.core.systems.OperaDriver.start(OperaDriver.java:358)
at com.opera.core.systems.OperaDriver.<init>(OperaDriver.java:312)
at com.opera.core.systems.OperaDriver.<init>(OperaDriver.java:213)
...
Caused by: com.opera.core.systems.scope.exceptions.ResponseNotReceivedException: No response in a timely fashion
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 12:59:39'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_02'
Driver info: driver.version: OperaDriver
at com.opera.core.systems.WaitState.pollResultItem(WaitState.java:435)
at com.opera.core.systems.WaitState.waitAndParseResult(WaitState.java:464)
at com.opera.core.systems.WaitState.waitForHandshake(WaitState.java:665)
at com.opera.core.systems.ScopeServices.waitForHandshake(ScopeServices.java:323)
at com.opera.core.systems.ScopeServices.init(ScopeServices.java:210)
at com.opera.core.systems.OperaDriver.init(OperaDriver.java:377)
at com.opera.core.systems.OperaDriver.start(OperaDriver.java:354)
... 30 more

It happens every time we run the tests via Ant (TestNG) and randomly from Eclipse (TestNG).

It does not happen on OSX or Linux.

Environment:

OS: Windows 7
Selenium: 2.15.0
OperaDriver: HEAD

Can you help?

Thanks,

Craig

Deploy to Maven Central

Could you make this dependency available on Maven central? It would make it much easier to generalize its use.

'opera failed to access or upgrade your profile'

I installed Opera 11.52 and am trying to use the Selenium webdriver bindings for Python to launch Opera with the Remote interface (Python bindings don't support Opera directly). Opera starts to launch, but gives the above 'Startup error'. It launches normally otherwise. I may try with Java just to see if that goes better. Any suggestions?

Send_Keys on File Input Not Working

I tried changes the value of a file input on both Mac and Windows. The input doesn't update and always returns an empty string.

Here is my code snippet:

    path = os.path.join(os.getcwd(), 'assets/'+dialog_text_input)
    self.find(locator).send_keys(path)

Extension Support

Is there a way to support extensions in OperaDriver?
I am looking for functionality similar to that of FirefoxDriver.

SocketTimeout Exception when running bundled WebDriver example

My code is as below:

DesiredCapabilities operaCapabilities = DesiredCapabilities.opera();
operaCapabilities.setCapability("opera.host", "127.0.0.1");
operaCapabilities.setCapability("opera.port", -1);
operaCapabilities.setCapability("opera.profile", "");

OperaDriver driver = new OperaDriver(operaCapabilities);

This generates an exception as so:

com.opera.core.systems.runner.OperaRunnerException: Timeout waiting for launcher to connect on port 29392
at com.opera.core.systems.runner.launcher.OperaLauncherRunner.(OperaLauncherRunner.java:159)
at com.opera.core.systems.OperaDriver.(OperaDriver.java:322)
at com.opera.core.systems.OperaDriver.(OperaDriver.java:224)
at com.test.TestMain.main(TestMain.java:31)
Caused by: java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
at java.net.ServerSocket.accept(ServerSocket.java:430)
at com.opera.core.systems.runner.launcher.OperaLauncherRunner.(OperaLauncherRunner.java:140)

... 3 more

I can see OperaLauncher icon appear in the system tray and opera also launches with speed dial page. But then I get socket timeout exception. I had set "opera.port" to -1 to force the port to 7001 (as in opera:config developer tools/Proxy Port setting), but still it tries to connect with a random port each time. I am not particular about any port, as long as I can get it to work somehow.

This seems to be a simple straightforward case, what am I missing?

I am using OperaDriver 0.10 (also tried 0.11 with same result) + Selenium 2.20.0 on Windows 7 with Opera 11.62, Build 1347 and Opera 11.52/Build 110.

Also I had issues with exceptions related to opera launcher not being present in the jar, so I had to download OperaLauncher.exe separately (Is this is cause?).

Thanks,
Ashwin

mouseout event not triggering for first div on page

If a div is the very first element in the body of a page, then mouseout events won't be generated if the mouse moves to the body.
If event handlers are registered on the topmost div for mouseout and mouseover events, moving the mouse results in a mouseover event firing, but no mouseout. In ChromeDriver, moving the mouse to the body generates the mouseout event anyway.

Setting Path to Opera Binary - Please Clarify

Though there's several comments in the documentation about setting the path to the binary, they are confusing, and inconsistent with documentation on Selenium WebDriver wiki. Also, I can't get them to work since upgrading to newer selenium 2.20.

With an earlier version of selenium 2.11, I was able to use the OperaDriverSettings object like is shown in the selenium wiki:
http://code.google.com/p/selenium/wiki/OperaDriver#Settings

OperaDriverSettings settings = new OperaDriverSettings();
settings.setOperaBinaryLocation("/path/to/opera");
WebDriver driver = new OperaDriver(settings);

Since around selenium 2.15, the OperaDriverSettings object doesn't exist, or if it does, the path has changed as this import statement fails: import com.opera.core.systems.settings.OperaDriverSettings;

Trying to fix this from the current documentation on github for OperaDriver, using the capabilities object or setting the system property should work, but cannot get Opera to launch when specifying the path this way. Here's the methods I've tried:

pathToOpera = "c:\Program Files\Opera 10.10 Beta\opera.exe"; //just happens to be where it is and not in a position to change it

//trying with capabilities
DesiredCapabilities capabilities = DesiredCapabilities.opera();
capabilities.setCapability("opera.binary",pathToOpera);
driver = new OperaDriver(capabilities);

//trying various set property methods
System.setProperty("opera.binary",pathToOpera);
System.setProperty("opera.path",pathToOpera); //at another point in the docs, it says to set "opera.path"
System.setProperty("webdriver.opera.binary");//notice added "webdriver" prefix since most other drivers look for this.
System.setProperty("opera.binary","c:\opera-wrapper-script.txt"); //tried using wrapper script
driver = new OperaDriver();

Setting OPERA_PATH as an environment variable is not an option for me.

So, with the capabilities object or setProperty method, should I be setting opera.binary or opera.path or webdriver.opera.binary, or what? Or maybe there's something else I am missing?

webDriver.close() causing org.openqa.selenium.WebDriverException: org.openqa.selenium.WebDriverException: Error on command: service: "window-manager"

Hello,

I am getting an exception when I run this code (which works perfectly with FireFox and Chrome):

final ThreadLocal<WebDriver> webDriver = new ThreadLocal<WebDriver>();
final OperaDriver driver = new OperaDriver();
webDriver.set(driver);
// Do stuff
webDriver.close();

Environment:

OS: OSX 10.7.2
Selenium: 2.15.0
OperaDriver: 0.8.1 / HEAD

StackTrace:

org.openqa.selenium.WebDriverException: org.openqa.selenium.WebDriverException: Error on command: service: "window-manager"
commandID: 1
format: 0
status: 4
tag: 106
payload: "\n\020No active window"

Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 12:59:39'
System info: os.name: 'Mac OS X', os.arch: 'amd64', os.version: '10.7.2', java.version: '1.7.0-u2-b21'
Driver info: driver.version: unknown
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 12:59:39'
System info: os.name: 'Mac OS X', os.arch: 'amd64', os.version: '10.7.2', java.version: '1.7.0-u2-b21'
Driver info: driver.version: unknown
at com.opera.core.systems.WaitState.onException(WaitState.java:253)
at com.opera.core.systems.ScopeServices.onException(ScopeServices.java:775)
at com.opera.core.systems.scope.stp.StpConnection.processMessage(StpConnection.java:546)
at com.opera.core.systems.scope.stp.StpConnection.readMessage(StpConnection.java:460)
at com.opera.core.systems.scope.stp.StpConnection.canRead(StpConnection.java:270)
at com.opera.core.systems.util.SocketMonitor.processSelectionKey(SocketMonitor.java:246)
at com.opera.core.systems.util.SocketMonitor.pollSockets(SocketMonitor.java:177)
at com.opera.core.systems.util.SocketMonitor.poll(SocketMonitor.java:149)
at com.opera.core.systems.scope.stp.StpThread.run(StpThread.java:60)
Caused by: org.openqa.selenium.WebDriverException: Error on command: service: "window-manager"
commandID: 1
format: 0
status: 4
tag: 106
payload: "\n\020No active window"

Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 12:59:39'
System info: os.name: 'Mac OS X', os.arch: 'amd64', os.version: '10.7.2', java.version: '1.7.0-u2-b21'
Driver info: driver.version: unknown
... 7 more

I hope someone can help.

Thanks,

Craig

org.openqa.selenium.WebDriverException: Unable to extract bundled launcher: Unknown file: null

Hello,

I am trying to run Selenium tests using OperaDriver but they fail to launch because it cannot find the launcher.

I've tried specifying the location as follows but it didn't work:

final DesiredCapabilities capabilities = DesiredCapabilities.opera();
capabilities.setCapability("opera.launcher", "/path/to/launcher-mac");
final OperaDriver driver = new OperaDriver(capabilities);

The only way I have been able to make it work is by putting a breakpoint on line 88 of OperaLauncherRunnerSettings and modifying the value of the "path" variable.

Environment:

OS: OSX 10.7.2
Selenium: 2.15.0
OperaDriver: 0.8.1

StackTrace:

org.openqa.selenium.WebDriverException: Unable to extract bundled launcher: Unknown file: null
Build info: version: '2.13.0', revision: '14794', time: '2011-11-18 17:49:47'
System info: os.name: 'Mac OS X', os.arch: 'amd64', os.version: '10.7.2', java.version: '1.7.0-u2-b21'
Driver info: driver.version: OperaDriver
at com.opera.core.systems.runner.launcher.OperaLauncherRunnerSettings.launcherPath(OperaLauncherRunnerSettings.java:97)
at com.opera.core.systems.runner.launcher.OperaLauncherRunnerSettings.getLauncher(OperaLauncherRunnerSettings.java:47)
at com.opera.core.systems.runner.launcher.OperaLauncherRunnerSettings.makeLauncherExecutable(OperaLauncherRunnerSettings.java:190)
at com.opera.core.systems.runner.launcher.OperaLauncherRunner.(OperaLauncherRunner.java:120)
at com.opera.core.systems.OperaDriver.(OperaDriver.java:295)

I hope someone can help.

Thanks,

Craig

Using OperaDriver with proxy settings

Hi,

how to start Opera via RemoteWebDriver with proxy settings?

this does not work

DesiredCapabilities cap = DesiredCapabilities.opera();
Proxy proxy = new Proxy();
proxy.setHttpProxy(proxyHost + ":" + proxyPort);
cap.setCapability(CapabilityType.PROXY, proxy);
RemoteWebDriver wd = new RemoteWebDriver(wdURL, cap);

and this too:

DesiredCapabilities cap = DesiredCapabilities.opera();
Proxy proxy = new Proxy();
proxy.setProxyAutoconfigUrl(proxyAutoconfig);
cap.setCapability(CapabilityType.PROXY, proxy);
RemoteWebDriver wd = new RemoteWebDriver(wdURL, cap);

Sergey

Using OperaDriver with Opera Mobile

Hi,

I am trying to configure OperaDriver with Opera Mobile. When I follow the tutorial on http://code.google.com/p/selenium/wiki/OperaDriver the tests fail on:

FINE: opera: Unknown/incorrect option "-autotestmode".

I've noticed there is a workaround for this issue and created bash file and set it as a "opera.binary" capabality:

#!/bin/sh
/blah/blah/operamobile

The browser starts successfully using this script, but opening the page in that browser fails on:

com.opera.core.systems.scope.exceptions.ResponseNotReceivedException: No response in a timely fashion

I am using Opera Mobile 12 and OperaDriver 0.11. My code is:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("opera.port", "-1");
capabilities.setCapability("opera.profile", "");
capabilities.setCapability("opera.binary", "/tmp/operawrapper.sh");
OperaDriver driver = new OperaDriver(capabilities);
driver.navigate().to("http://www.opera.com/");

Test automatic downloads via selenium2

Hi,
in my selenium testcase i need to download files automatically in my testcase. It should be possible
to configure the opera driver in a way, so the download dialog does not show up, and the file is automatically
downloaded and written to a configurable directory.
Ideally the download directory and the enabling/disabling of the download dialog should be configurable
via the operadriver and the java api (for example just like for the firefox profile):

for firefox i can configure all pdf dowloads to be saved directely to a directory. it would be nice, if
opera would support that as well.

firefoxProfile.setPreference("browser.download.dir", TMP_DIR);
firefoxProfile.setPreference("browser.download.folderList", 2);
firefoxProfile.setPreference("browser.download.defaultFolder", TMP_DIR);
firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf");

cheers,
andy

Exceptions on handling page loads: No response in a timely fashion

I see this topic in both the open and closed issues, but decided to open a new one as it's time for me to really delve into this issue. It would be greatly appreciated if we can work closely to resolve this and apparently would also be helpful to many others, in addition to getting OperaDriver up to par as a solid automation testing tool.

I have multiple URLs/pages (meaning 1000s) that throw exceptions or cause Opera to crash and close with OperaDriver. These same pages work fine with the other browser's WebDrivers. In fact these same URLs load fine in Opera when run normally. This has been an ongoing issue but have not had time focus in on it until now. I believe this is the same issue that others are referring to related to long page loads or heavy javascript functions on document ready.

Before I dump a lot of information, like log data, URLs that fail, browser/selenium/platform versions, I want to ask if you guys have a sense that there's a problem here? That there is something failing with the way OperaDriver launches with an autotest profile, loads a given page, determines that the document is loaded and ready, and then returns control to the initialized driver.

(A little background: I built and manage the screenshot system for a web service that runs on selenium webdriver. We offer screenshots across multiple OS/Browser combos and run 1000s a day. I have spent a lot of time getting OperaDriver working to the point that it is, and of all the requests, Opera fails the most and usually fails in the startup and page load process. Here's a copy of my log of the top five failures for today:)

Windows 7/Opera 11.5, failed 124, good 50
Windows 7/Internet Explorer 8, failed 24, good 73
Windows XP SP2/Internet Explorer 7, failed 23, good 153
Windows Vista/Internet Explorer 7, failed 20, good 72
Windows XP SP2/Internet Explorer 6, failed 18, good 113

Currently we are in the process of upgrading our 11.5's to 11.62 (the latest as of the time this is being written) across all of our virtual instances. On my local machine I have been testing with the latest and am still seeing the issue. Here's my specs:

Window 7 64-bit
Opera 11.62
Selenium 2.20

Here's a recent URL of a customer that fails: http://martinpresse.com/

Here are a couple of reasons (I am guessing at the moment) for why I think OperaDriver fails to load a URL:

  • there is an element that isn't loading quick enough (I see 20/21 in the address bar most of the time, where one element isn't finishing the load)
  • javascript loads more elements on DOM ready.
  • visually I see cases where Opera loads the html but the images don't show up - in the URL mentioned above, the page has one image file that was not found... could that be a cause?
  • external resources to google analytics or maps

Let me know your thoughts or if I can provide more information.

Thanks,
Luke

NullPointerException when use GetText command

In the org.openqa.selenium.internal.seleniumemulation.GetText#handleSeleneseCommand() method, if the WebDriverException happened, it will use finder.findElement() to receive the element again, but in OperaDriver, it will close the connection when the exception happened.

The exception will cause at com.opera.core.systems.ScopeServices#executeCommand(),

For example,

connection.send(commandBuilder.build());

Note that the connection in this case is null.

Race Condition

I'm using the Java API with Selenium-WebDriver 2 to test against Opera. My setup:

  • Mac OSX Lion
  • OperaDriver 0.9
  • Selenium-WebDriver 2.16.0
  • Opera 11.6

When I find a link using XPath, click on it, and then check the current URL of the driver, I get different results. By default, I get the URL of the driver before I clicked on the link. If I add a Thread sleep call in my code (e.g., for 1000 milliseconds), then OperaDriver returns the correct URL of the page after the link is clicked.

I have not seen this issue with Firefox or Chrome drivers.

OperaDriver sets font color in console to white (light gray)

I use white background in my console and after I run tests using OperaDriver I must reset its state, because the OperaDriver sets font color to white (light gray) and the text isn't readable.

I suggest to avoid setting the font color in OperaDriver.

OperaDriver implements interfaces that are already implemented via RemoteDriver

Hi,

the OperaDriver class implements lots of interfaces that are already implemented via the RemoteWebDriver class.
I guess the "implements " can be completely removed.

public class OperaDriver extends RemoteWebDriver implements WebDriver,
    FindsByLinkText, FindsById, FindsByXPath, FindsByName, FindsByTagName,
    FindsByClassName, FindsByCssSelector, SearchContext, JavascriptExecutor,
    TakesScreenshot, HasInputDevices {

cheers,
and

Browser is not closed when calling WebDriver#close()

When the method WebDriver#close() is called on the OperaWebDriver the browser is not closed, but only the current tab (the first time I see Opera without any tab).

This makes it impossible to test multiple Opera versions through one test suite.

Can not run launcher-win32-i86pc.exe on Windows XP

Hi everyone,
I'm trying to test my Selenium 2 tests in Opera, exactly on Windows XP.

My tests are written in Java. And, to test the connection to Opera, only 'WebDriver driver = new OperaDriver();' is executed.

When I execute previous code, the following exception appears:

Could not start the process : Cannot run program 'C:\Documents and Settings\User.launcher\launcher-win32-i86pc.exe'. No se pudo iniciar la aplicación porque su configuración es incorrecta. Reinstalar la aplicación puede solucionar el problema (in english: Can not initiate the application because your configuration is incorrect. Reinstall the application could solve the problem.).

I have executed the 'launcher-win32-i86pc.exe' file directly and the same error appears.

Reading from internet, I have discovered that Visual C++ redistributable package is needed, and I have installed it, but it did not solve the problem. Is anything more needed?

Thanks in advance.

`ant test` doesn't run cleanly out of the box

NavigationTest#testHttpRedirect depends on http://t/core/bts/javascript/CORE-26410/003-2.php resolving and being present

All of the following fail with both 11.62 Build 1347 and 12.00 beta Build 1406 on Mac OSX 10.6.8 at commit 3d3d83e (no local changes):

OperaSettingsTest#{productIsDesktop,supportsPdIsTrueByDefault}
OperaSettingsIntegrationTest#{profileIsRespected,portSetToDefaultIdentifier,testSettingPort}
OperaDriverTest#testDefaultPort
OperaRunnerTest#{testConstruction,testConstructionWithProfile,testConstructionWithPort}
OperaSettingsCapabilitiesTest#productHasOperaProductDesktopAsDefaultValue

Support for entire page screenshot

Hi,

The screenshotting functionality seems to be broken. It gives the screenshot of the whole desktop instead of just the webpage inside the browser.

Here is the code i'm using to test this:

WebDriver driver = new OperaDriver();
driver.get("http://news.google.com");
ScreenShotReply scr = ((OperaDriver) driver).saveScreenshot(0);
FileUtils.writeByteArrayToFile(new File("c:\temp\screenshot.png"), scr.getPng());

In my experience, it is best supported in FirefoxDriver. So, it would be nice to have it work the same way in OperaDriver too.
Also, it would be great if opera screenshotting mechanism would follow the standard WebDriver TakesScreenshot interface so that it can be interoperable with other webdrivers as well.

Thanks,
Shauvik

OperaDriver should extend RemoteWebDriver

Plase make the OperaDriver class extend the RemoteWebDriver class, because this class contains all the interfaces needed for testing. In my testcases i want to switch between the driver implementations with a system property switch and i do not want to have different implementations.

Using the RemoteWebDriver i can write my tests independent of the Driver implementation. since the OperaDriver implements directly i cannot use it directly. i have to introduce a custom Interface and extends all DriverClasses that i use with something like:

public interface Driver extends TakesScreenshot, FindsByClassName, HasInputDevices, ........ {

}

with this interface i can write my test driver independent.

Extending the RemoteWebDriver should not be that difficult i think, all the additional interface methods that need to be implemented or do not work should throw a NotYetImplemented exception or something like that. or did i miss something?

Mobile Emulator not found

Hello!
I'm try use and understand Opera Mobile Driver with Mobile Emulator running a WebDriver script, like I found on this blog post http://dev.opera.com/articles/view/introducing-mobile-browser-automation/

What happens
When I try to run the following code I receive an error: "Exception in thread "main" java.lang.IllegalStateException: The executable is a directory: /Applications/Opera Mobile Emulator.app"

Code:

DesiredCapabilities dc = DesiredCapabilities.opera();
dc.setCapability("opera.product", OperaProduct.MOBILE);
dc.setCapability("opera.binary", "/Applications/Opera Mobile Emulator.app");

WebDriver driver = new OperaDriver(dc);

I'm using operadriver v1.1

Best regards!

Incorrect behavior of Opera browser for sendkeys commands

Latest stable Opera on WinXP, Vista or Linux, Selenium java and server 2.19 (operaDriver 0.10, latest).
I.'m testing one russian search engine. Tests contains a lot of Cyrillic and special symbols. And after 4th test opera thinks that hotkey was pressed (like zoom or ctrl+F). And all tests from "send keys" comes to Find bar in opera instead of search field from my site.

here are this test:

"К нам на утренний рассол"
"Прибыл * посол"
полгорбушки & мосол
снаряжайся && добудь
глухаря | куропатку | кого-нибудь
не смогешь << винить
я должон /2 казнить
государственное дело && /3 улавливаешь нить
нешто я ~~ пойму
при моем /+2 уму
чай ~ лаптем
щи /(-1 +2) хлебаю
!Соображаю !что !чему
получается && (+на | !мне)
!!политика
title:(в стране)
url:ptici.narod.ru/ptici/kuropatka.htm
беспременно inurl:vojne
host:lib.ru
rhost:ru.lib.*
site:http://www.lib.ru/PXESY/FILATOW
mime:pdf
lang:en
domain:ru
date:200712*
date:20071215..20080101, date:>20091231
cat:11000051

sendKeys fails on Mac OSX, Opera 11.5 By.id, By.name, or By.xpath

Mac OS X 10.6, the Opera 11.5 version, a WebElement fails to sendKeys or Click after retrieving element. Not receiving an error message, just not actually functioning on the browser.

Using Selenium 2.6.0, which I believe is using the latest OperaDriver version release.

I discovered this during tests of my sites, but tested this on yahoo as well:

URL: https://login.yahoo.com/config/login
username element: id=username, name=username, or //input[@name='username']
password element: id=passwd, name=passwd, or //input[@name='passwd']
submit element: id=.save, name=.save, or //button[@name='.save']

This was working in earlier release, the one in Selenium 2.4.0

No response in a timely manner on Opera 11.51

When trying to launch Opera WebDriver from Java (Version 0.7 from maven repository) with one of the following codes:

DesiredCapabilities operaCapabilities = DesiredCapabilities.opera();
WebDriver driver = new OperaDriver(operaCapabilities);

or after starting explizit Selenium Hub and a webdriver instance like this:

java -jar selenium-2.5.0/selenium-server-standalone-2.5.0.jar -role hub

and

java -jar selenium-2.5.0/selenium-server-standalone-2.5.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 5556 -browser browserName=opera,version=11.51
DesiredCapabilities operaCapabilities = DesiredCapabilities.opera();
WebDriver driver = new OperaDriver(operaCapabilities);

i'm allways just seeing an opera window with "connecting to debugger" (opera:debug), when clicking to connect, nothing happens, clicking a second time brings a "connection failed" message. Maybe I'm missing something on how to use opera webdriver, but couldn't find any hint ...

System:

  • OperaDriver 0.7
  • Opera 11.51
  • Ubuntu 11.04 64-bit

PS: When setting

operaCapabilities.setCapability("opera.autostart", false);

and manually connecting to WebDriver is working - but hard to automate it ;o)

opens opera:debug page. No response in a timely fashion

Hello! I hope someone can help me with my problem.
I use selenium 2.17.0
Run my tests on virtual mashine with windows 7
Opera version 11.60

When I run test in opera, it opens opera:debug page and nothing more. After some time it falls with org.openqa.selenium.WebDriverException: No response in a timely fashion.

I check opera:config. There is enable Proxy Auto Connect.

How can I solve this problem?

getCssValue() throws java.lang.NumberFormatException: For input string: "transparent"

Hello,

I am getting an exception when I run this code (which works perfectly with FireFox and Chrome):

final ThreadLocal<WebDriver> webDriver = new ThreadLocal<WebDriver>();
final OperaDriver driver = new OperaDriver();
webDriver.set(driver);
final WebElement element = getWebDriver().findElement(By.cssSelector("xpath"));
return element.getCssValue("background-color");

Environment:

OS: OSX 10.7.2
Selenium: 2.15.0
OperaDriver: 0.8.1 / HEAD

StackTrace:

java.lang.NumberFormatException: For input string: "transparent"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492)
at java.lang.Integer.valueOf(Integer.java:582)
at com.opera.core.systems.model.OperaColor.(OperaColor.java:57)
at com.opera.core.systems.OperaWebElement.getCssValue(OperaWebElement.java:685)

I understand what is causing the exception but I believe that you should be handling it. Do you agree?

Thanks,

Craig

OperaDriver fails to use launcher to run opera on Windows

Something changes between selenium 2.11.0 and 2.13.0. I was able to run tests on Opera 11.5 on Windows 7 no problem, then with upgrade to 2.13.0, suddenly getting this message:

"Unable to extract bundled launcher: Unable to set modification time for file: C:\Users\you.launcher\launcher-win32-i86pc.exe "

Not sure that 2.11 uses the bundled launcher. It's as if there's some sort of permission or timing issue here because when scripted, I get the message above, but when manually run my test on command line, it appears to work ok.

If I'm right in that 2.11 did not use a launcher binary, then is there a setting to not use this launcher until I get permission settings checked out? Or is there something else I should be aware of with the launcher?

Creating a new RemoteWebDriver instance with the given session id throws BindException

Hi,

we try to reuse sessions from the previous test execution to speed-up test development. The browser doesn't have to start from the scratch and only a driver instance is created (see http://arquillian.org/blog/2012/06/27/arquillian-extension-drone-1-1-0-CR1/).

However OperaDriver is not able to reuse the session (the session is reused here: https://github.com/arquillian/arquillian-extension-drone/blob/master/drone-webdriver/src/main/java/org/jboss/arquillian/drone/webdriver/factory/remote/reusable/ReusableRemoteWebDriver.java#L78) and throws java.net.BindException: Address already in use.

The full stack trace is available here: https://gist.github.com/3088879.

Maven Repository

Hi,
is it possible to provide the operadriver (releases/snapshots) via a maven repository?
That would be a much more convenient way to get the files.

thanks in advance,
cheers,
Andy

Opera versions supported?

Not sure where else to ask this question, so posting here in the issue list.

What is the officially supported Opera versions for OperaDriver? The Selenium Wiki says only 11.5 and higher is supported, but I don't see this indicated on ReadMe.markdown ( nor the main page here on github for operadriver).

When I look through changes.markdown, I see where at one point earlier versions were supported:

2011/06/27 OperaDriver 0.5.1
Bug fixes

Core Scope service no longer required, to support earlier Opera versions. (stuartk)

Shutdown Scope services in alternate way to support earlier Opera versions. (stuartk)

...but there's no mention of a version that stopped this support.

I always test on earlier versions of browsers with Selenium regardless of documentation because I need to test a wide base of browsers and on various platforms, both old and new. Currently I have working versions (for the most part) of 10.60 and 10.50 on Windows, but they do have odd issues now and again on certain sites.

I'd love it if support for 9.6 and above were a possibility but I understand that STP/0 is not supported. Maybe 10 and above?

Thanks.

Opera 11.01 and below is not working properly with operadriver

I was trying to run very simply perl test case in opera browser 11.01 and below versions like 11.00, 10.64 and others, even if i add all capabilities that are mentioned in opera driver its not running the test properly. Its launching the browser but not creating the driver object. Is it possible to run tests on opera 10 and 9 using operadriver?

Same test case is working fine form 11.10 to latest version of opera.

platform:Linux
Selenium-Remote-Driver-0.15.tar.gz
selenium-server-standalone-2.20.0.jar

use Selenium::Remote::Driver;
my $driver = new Selenium::Remote::Driver('browser_name' => 'opera','extra_capabilities' => {'opera.binary' => 'operawrapper','opera.profile' => '','opera.port' => '-1','opera.logging.level' => 'FINE',},);
$driver->get("http://www.google.com/");
print $driver->get_title();
$driver->quit();

12:33:21.576 INFO - Executing: org.openqa.selenium.remote.server.handler.Status@32bd65 at URL: /status)
12:33:21.576 INFO - Executing: org.openqa.selenium.remote.server.handler.Status@32bd65 at URL: /status)
12:33:21.577 INFO - Done: /status
12:33:21.577 INFO - Done: /status
12:33:21.580 INFO - Executing: [new session: {opera.binary=/home/likewise-open/VITBDC/na..., platform=ANY, opera.launcher=/.launcher, javascriptEnabled=true, acceptSslCerts=true, opera.host=localhost, browserName=opera, proxy={httpProxy=localhost:8080, pr..., opera.logging.level=FINE, opera.profile=, opera.port=-1, version=}] at URL: /session)
12:33:21.580 INFO - Executing: [new session: {opera.binary=/home/likewise-open/VITBDC/na..., platform=ANY, opera.launcher=/.launcher, javascriptEnabled=true, acceptSslCerts=true, opera.host=localhost, browserName=opera, proxy={httpProxy=localhost:8080, pr..., opera.logging.level=FINE, opera.profile=, opera.port=-1, version=}] at URL: /session)
12:33:21.583 CONFIG - Opera arguments: [-autotestmode]
12:33:21.583 CONFIG - Opera arguments: [-autotestmode]
12:33:21.583 CONFIG - launcher arguments: [-host, 127.0.0.1, -port, 2544, -console, -verbosity, FINE, -profile, desktop, -backend, software, -bin, /home/likewise-open/VITBDC/namrathar/operawrapper, -autotestmode]
12:33:21.583 CONFIG - launcher arguments: [-host, 127.0.0.1, -port, 2544, -console, -verbosity, FINE, -profile, desktop, -backend, software, -bin, /home/likewise-open/VITBDC/namrathar/operawrapper, -autotestmode]
12:33:21.659 DEBUG - launcher: Operalauncher starting with the following configuration:
12:33:21.659 DEBUG - launcher: Operalauncher starting with the following configuration:
12:33:21.659 DEBUG - launcher: -bin: /home/likewise-open/VITBDC/namrathar/operawrapper
12:33:21.659 DEBUG - launcher: -bin: /home/likewise-open/VITBDC/namrathar/operawrapper
12:33:21.659 DEBUG - launcher: -host: 127.0.0.1
12:33:21.659 DEBUG - launcher: -host: 127.0.0.1
12:33:21.660 DEBUG - launcher: -port: 2544
12:33:21.660 DEBUG - launcher: -port: 2544
12:33:21.666 DEBUG - Waiting for launcher connection on port 2544
12:33:21.666 DEBUG - Waiting for launcher connection on port 2544
12:33:21.668 DEBUG - launcher: Blank screenshot has MD5: 0x6f5e1a4118e2d7f6f5f4a3a0ba14144c
12:33:21.668 DEBUG - launcher: Blank screenshot has MD5: 0x6f5e1a4118e2d7f6f5f4a3a0ba14144c
12:33:21.668 DEBUG - opera: [INFO] --> Entering LauncherRunner::run
12:33:21.668 DEBUG - opera: [INFO] --> Entering LauncherRunner::run
12:33:22.668 DEBUG - Got launcher connection from /127.0.0.1:36961
12:33:22.668 DEBUG - Got launcher connection from /127.0.0.1:36961
12:33:22.668 DEBUG - Connected with launcher on port 2544
12:33:22.668 DEBUG - Connected with launcher on port 2544
12:33:22.669 CONFIG - Capabilities [{platform=ANY, opera.binary=/home/likewise-open/VITBDC/namrathar/operawrapper, acceptSslCerts=true, javascriptEnabled=true, opera.host=localhost, opera.idle=false, browserName=opera, opera.autostart=true, opera.logging.file=null, opera.guess_binary_path=true, opera.logging.level=FINE, opera.profile=com.opera.core.systems.OperaProfile@19f03d7, version=, opera.launcher=/.launcher, proxy={httpProxy=localhost:8080, proxyType=manual}, opera.display=null, opera.product=core-gogi, opera.arguments=, opera.no_quit=false, opera.backend=software, opera.port=7001, opera.no_restart=false}]
12:33:22.669 CONFIG - Capabilities [{platform=ANY, opera.binary=/home/likewise-open/VITBDC/namrathar/operawrapper, acceptSslCerts=true, javascriptEnabled=true, opera.host=localhost, opera.idle=false, browserName=opera, opera.autostart=true, opera.logging.file=null, opera.guess_binary_path=true, opera.logging.level=FINE, opera.profile=com.opera.core.systems.OperaProfile@19f03d7, version=, opera.launcher=/.launcher, proxy={httpProxy=localhost:8080, proxyType=manual}, opera.display=null, opera.product=core-gogi, opera.arguments=, opera.no_quit=false, opera.backend=software, opera.port=7001, opera.no_restart=false}]
12:33:22.670 DEBUG - Instructing launcher to start Opera...
12:33:22.670 DEBUG - Instructing launcher to start Opera...
12:33:22.772 DEBUG - Opera launched through launcher
12:33:22.772 DEBUG - Opera launched through launcher
12:33:52.773 DEBUG - Shutting down STP connection listener
12:33:52.773 DEBUG - Shutting down STP connection listener
12:33:52.773 DEBUG - OperaDriver shutting down
12:33:52.773 DEBUG - OperaDriver shutting down
12:33:52.773 DEBUG - Shutting down launcher
12:33:52.773 DEBUG - Shutting down launcher
12:33:52.775 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27 19:03:04'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-40-generic', java.version: '1.6.0_26'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:139)
at org.openqa.selenium.remote.server.DefaultSession.(DefaultSession.java:108)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:86)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:87)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:62)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:196)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:580)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:531)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:503)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27 19:03:04'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-40-generic', java.version: '1.6.0_26'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:73)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:57)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:177)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:63)
... 8 more
Caused by: org.openqa.selenium.WebDriverException: com.opera.core.systems.scope.exceptions.ResponseNotReceivedException: No response in a timely fashion
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27 19:03:04'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-40-generic', java.version: '1.6.0_26'
Driver info: driver.version: OperaDriver
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27 19:03:04'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-40-generic', java.version: '1.6.0_26'
Driver info: driver.version: OperaDriver
at com.opera.core.systems.OperaDriver.start(OperaDriver.java:379)
at com.opera.core.systems.OperaDriver.(OperaDriver.java:330)
... 13 more
Caused by: com.opera.core.systems.scope.exceptions.ResponseNotReceivedException: No response in a timely fashion
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27 19:03:04'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-40-generic', java.version: '1.6.0_26'
Driver info: driver.version: OperaDriver
at com.opera.core.systems.WaitState.pollResultItem(WaitState.java:435)
at com.opera.core.systems.WaitState.waitAndParseResult(WaitState.java:464)
at com.opera.core.systems.WaitState.waitForHandshake(WaitState.java:665)
at com.opera.core.systems.ScopeServices.waitForHandshake(ScopeServices.java:323)
at com.opera.core.systems.ScopeServices.init(ScopeServices.java:210)
at com.opera.core.systems.OperaDriver.init(OperaDriver.java:398)
at com.opera.core.systems.OperaDriver.start(OperaDriver.java:375)
... 14 more
12:33:52.777 WARN - Exception: No response in a timely fashion
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27 19:03:04'
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.32-40-generic', java.version: '1.6.0_26'
Driver info: driver.version: OperaDriver

wait time set to 0 in findElement

In class OperaDriver on row 1166:

OperaIntervals.WAIT_FOR_ELEMENT.setValue(0L);

This destroys the setup of my driver:

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

Invalid coordinates on click after moveto

Hi,

I'm using OperaDriver as part of Selenium Server and I interact with Opera via the JsonWire Protocol.

According to the documentation for /click:

Click any mouse button (at the coordinates set by the last moveto command).

However that throws an exception:

org.openqa.selenium.interactions.InvalidCoordinatesException: Invalid coordinates to click on
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27 19:03:04'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.3', java.version: '1.6.0_29'
Driver info: driver.version: unknown
at com.opera.core.systems.OperaMouse.getPoint(OperaMouse.java:88)
at com.opera.core.systems.OperaMouse.click(OperaMouse.java:36)... etc, etc

These are the steps to reproduce the issue (HTTP method, URL and Request Body):

  1. POST: /session

    BODY: {"desiredCapabilities":{"browserName":"opera"}}

  2. POST: /session/:sessionId/url

    BODY: {"url": "http://fiddle.jshell.net/eliseosoto/UgHpJ/11/show/light/"}

  3. POST: /session/:sessionId/element

    BODY: {"using": "xpath", "value": "//*[@id='addMessage']"}

  4. POST: /session/:sessionId/moveto

    BODY: {"element": "0"}

  5. POST: /session/:sessionId/click

    BODY: {"button": 0}

In step 4 I'm using /moveto to move to the button, I'm only specifying the element id so according to the docs it should move to the middle of the element.

Step 5 attempts to perform a left click (button 0) and that's when I get the exception.

I've tried the same steps with ChromeDriver and FirefoxDriver and it works fine.

The only way I've found to click on Opera is to do this but it's not ideal in my case, nevertheless Opera should follow the JsonWire Protocol in a consistent manner.

POST /session/:sessionId/element/0/click

Does Operadriver support WebDriver alert api

Hi,

I am using selenium-server-standalone-2.8.0 with DotNet webdriver 2.8. And I tested both on Opera 11.50 and 11.51, it seems Operadriver cannot handle javascript alert popup window. The follow line is always throw exception:

Driver.SwitchTo().Alert();


System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> System.InvalidOperationException : No response in a timely fashion.
Build info: version: '2.8.0', revision: '14056', time: '2011-10-06 12:41:26'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_29'
Driver info: driver.version: OperaDriver
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at OpenQA.Selenium.Support.PageObjects.PageFactory.ProxiedWebElementInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.IWrapsElementProxy.Click()


It works fine on other browsers.

Does Does Operadriver support WebDriver alert api?

Cheers,

Can't return array of nodes using JavascriptExecutor.executeScript

Hi,

I'm trying to make this code work, but it gets stuck at the second line :
JavascriptExecutor js = (JavascriptExecutor) this.driver;
List<WebElement> divs = (List<WebElement>) js.executeScript("return [document.createElement('div'), document.createElement('div')]");

Nothing happens, it's just blocked.

These three cases work :

  • WebElement div = (WebElement) js.executeScript("return document.createElement('div')");
  • List<String> testStrings = (List<String>) js.executeScript("return ['pouet', 'pouet1'];");
  • String testString = (String) js.executeScript("return 'pouet';");

The first one returns a node, the second returns an array of strings, the last one returns a String.
But the array of nodes doesn't work. It works perfectly in Firefox using FirefoxDriver.

This code is just an example. What I'm trying to do is getting nodes using a CSS selector with a ":contains" pseudo-class. But this pseudo-class is not implemented in WebDriver (more details about this : http://prototypic.net/blog/creating-a-sizzle-css-selector-handler-for-selenium2webdriver-in-java/), so I have to use Javascript (I'm not using this Sizzle class).

Thanks.

I use :

  • Opera Next 11.50 b1074 (Linux, i686) ;
  • selenium-server-standalone-2.2.0.jar (doesn't work either with selenium-server-standalone-2.1.0.jar) ;
  • OpenJDK Runtime Environment (IcedTea6 1.9.2) (6b20-1.9.2-0ubuntu2)
  • OpenJDK Client VM (build 19.0-b09, mixed mode, sharing)

This is how I instanciate the driver :
OperaDriverSettings settings = new OperaDriverSettings();
settings.setOperaBinaryLocation(System.getProperty("opera.launcher")); // path to opera-next
settings.setOperaLauncherListeningPort(63411);
this.driver = new OperaDriver(settings);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.