Using Opera with Watir-Webdriver (for free)

Selenium 2.0 (WebDriver) was released today, and with it came support for Opera. Since Watir-WebDriver uses the WebDriver bindings, it now supports Opera out of the box.

How to get it working

  1. First make sure you have the latest watir-webdriver (>0.2.5) and selenium-webdriver (>2.0.0) gems installed.
  2. Install Opera if you haven’t already
  3. Download the latest Selenium Standalone Server JAR files to your computer
  4. Create an Environment Variable named SELENIUM_SERVER_JAR and set it to the path to your standalone server JAR file
    (On the mac, you can add something like this to your .bash_profile file:
    export SELENIUM_SERVER_JAR=/Library/Java/selenium-server-standalone-2.0.0.jar
  5. Open irb, require ‘watir-webdriver’, and type something like
    b = :opera

    and ta-da: Opera automated testing.

Author: Alister Scott

Alister is an Excellence Wrangler for Automattic.

4 thoughts on “Using Opera with Watir-Webdriver (for free)”

  1. Hi Alister,

    How would I go about this process if I’m working with a pre-release of selenium webdriver using the following command:

    gem install selenium-webdriver –pre


  2. I try to drive opera on windows7 but IE browser open…………
    I have installed opera, selenium standalone server.


    1. 11:34:11.123 INFO – Started HttpContext[/wd,/wd]
      11:34:11.128 INFO – Started SocketListener on
      11:34:11.128 INFO – Started org.openqa.jetty.jetty.Server@17ff3f5d
      11:34:29.338 INFO – Executing: [new session: {platform=ANY, javascriptEnab
      ue, cssSelectorsEnabled=true, browserName=opera, nativeEvents=false, rotat
      alse, takesScreenshot=true, version=}] at URL: /session)
      11:34:29.352 INFO – Creating a new session for Capabilities [{platform=ANY
      electorsEnabled=true, javascriptEnabled=true, browserName=opera, nativeEve
      lse, rotatable=false, takesScreenshot=true, version=}]
      Started InternetExplorerDriver server (32-bit)


Comments are closed.