{"id":30700114,"url":"https://github.com/operasoftware/operawatir","last_synced_at":"2025-09-02T11:44:05.124Z","repository":{"id":1245969,"uuid":"1184434","full_name":"operasoftware/operawatir","owner":"operasoftware","description":"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.","archived":false,"fork":false,"pushed_at":"2011-12-01T15:37:51.000Z","size":92544,"stargazers_count":46,"open_issues_count":2,"forks_count":9,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-08-09T20:53:48.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://operawatir.org/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/operasoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-20T14:42:28.000Z","updated_at":"2024-12-22T18:46:36.000Z","dependencies_parsed_at":"2022-08-16T12:45:09.662Z","dependency_job_id":null,"html_url":"https://github.com/operasoftware/operawatir","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/operasoftware/operawatir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Foperawatir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Foperawatir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Foperawatir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Foperawatir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/operasoftware","download_url":"https://codeload.github.com/operasoftware/operawatir/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operasoftware%2Foperawatir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273279912,"owners_count":25077318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-02T11:43:28.699Z","updated_at":"2025-09-02T11:44:05.097Z","avatar_url":"https://github.com/operasoftware.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Readme\n\n[OperaWatir](http://operawatir.org/) is a part of the [Watir](http://watir.com/) (pronounced _water_) family of free software Ruby libraries for automating web browsers.  OperaWatir provides a querying engine and Ruby bindings for a backend Java library, OperaDriver, for driving the [Opera web browser](http://opera.com/).  It aims for full compliance with the [Watir 2](https://github.com/jarib/watirspec) and the [Watir 3](https://github.com/operasoftware/watir3-spec) specifications.\n\n* __License:__ [New BSD](https://github.com/operasoftware/operawatir/blob/master/LICENSE)\n* __Project Home:__ [http://www.opera.com/developer/tools/operawatir/](http://www.opera.com/developer/tools/operawatir/)\n* __Source Code:__ [https://github.com/operasoftware/operawatir](https://github.com/operasoftware/operawatir)\n* __Mailing List:__ [https://list.opera.com/mailman/listinfo/operawatir-users](https://list.opera.com/mailman/listinfo/operawatir-users)\n* __Issues:__ [https://github.com/operasoftware/operawatir/issues](https://github.com/operasoftware/operawatir/issues)\n* __Gem:__ [https://rubygems.org/operawatir](http://rubygems.org/gems/operawatir)\n\n## Install\n\n### Requirements\n\nOperaWatir runs on GNU/Linux, Mac OS X and Windows operating systems. Required dependencies are _Java_ \u003e= 1.6.0, _JRuby_ \u003c= 1.5.5, _RubyGems_ \u003e= 1.3.5, _RSpec_ \u003e= 2.4, and a somewhat recent build of Opera (desktop, internal, mobile).  For Windows you must also have the Microsoft Visual C++ 2008 Redistributable Package.\n\n### Installation procedure\n\nMake sure that you have the right requirements for installing and running OperaWatir.  Please note that OperaWatir will only run on the JRuby platform. For more detailed installation instructions, please see our [Getting Started](http://dev.opera.com/articles/view/opera-watir-tutorial/) guide.\n\nTo install (leave out the “sudo” command if you're installing on Windows):\n\n    % sudo jruby -S gem install operawatir\n\nNext, make sure that JRuby's ``bin`` directory is a part of your ``PATH`` environmental variable on GNU/Linux.\n\n## Examples\n\nThe Watir API allows you to write scripts that interact with any web page.  Its primary purpose is to ease test automation for web applications.  Your scripts can, for example, before you deploy automatically go through all the steps your users normally would and alert you of any regressions. \n\nLet's take a closer look at how this works. \n\n    require 'rubygems'\n    require 'operawatir'\n    \n    browser = OperaWatir::Browser.new\n    \n    browser.goto 'http://en.wikipedia.org/'\n    browser.text_field(:id, 'searchInput').set 'Opera'\n    browser.button(:id, 'searchButton').click\n\nThe script above will tell the browser to load the front page of Wikipedia, write “Opera” in the search field and click the search button.  If all goes as intended, the browser will end up at a relevant article. \n\nTo run the script, use the following command:\n\n    % jruby example.rb\n\nAs Watir scripts are run in a full-featured browser, all keypresses and clicks will be interpreted as if they were real, and invoke attached JavaScript event listeners.  If we want to test the JavaScript-powered suggestion feature on the Wikipedia search box, we can do this: \n\n    require 'rubygems'\n    require 'operawatir'\n    \n    browser = OperaWatir::Browser.new\n    \n    browser.goto 'http://en.wikipedia.org/'\n    browser.text_field(:id, 'searchInput').click\n    browser.type 'Hello world'\n    browser.keys.send :down, :enter\n\nThe first suggested link will be selected by pressing arrow down (``'Down'``) and navigated to (``'Enter'``).  Using the same key events, you could even teach a script to play platform games: \n\n    require 'rubygems'\n    require 'operawatir'\n  \n    browser.goto 'http://www.phoboslab.org/biolab/'\n    sleep 2\n    browser.keys.send 'X'\n    sleep 1\n    browser.keys.down :right\n    5.times { browser.keys.send 'X' }\n    2.times { browser.keys.send 'C' }\n    browser.keys.up :right\n\nSending commands to the browser is great, but sometimes we want to get something back too.  The following lines of code will have the browser automatically look up the phone number of Opera Software in the [yellow pages](http://gulesider.no/) and write it to the console.\n\n    require 'rubygems'\n    require 'operawatir'\n    \n    browser = OperaWatir::Browser.new\n    \n    browser.goto 'http://gulesider.no/'\n    browser.text_field(:name, 'search_word').set 'Opera Software'\n    browser.button(:name, 'btn_cs').click\n    puts browser.li(:class, 'tel').text\n\nWhen running proper functional tests on your web application with Watir, you might want a bit more structured output.  To define assertions and get pretty test reports, you can use [RSpec](http://rspec.info/), a behaviour-driven testing framework. \n\nWhen writing test suites you can use the OperaWatir::Helper class to help ease some tasks, such as constructing and tearing down the Browser object.  A simple test suite looks like this:\n\n    describe 'Yellow Pages' do\n      before :each do\n        browser.goto 'http://gulesider.no/'\n      end\n    \n      it 'finds the phone number to Opera Software' do\n        browser.text_field(:name, 'search_word').set 'Opera Software'\n        browser.button(:name, 'btn_cs').click\n        browser.li(:class =\u003e 'tel').text.should == '24 16 40 00'\n      end\n    \n      it 'finds the phone number to the Norwegian Opera and Ballet' do\n        browser.text_field(:name, 'search_word').set 'Den Norske Opera'\n        browser.button(:name, 'btn_cs').click\n        browser.li(:class, 'tel').text.should == '21 42 21 00'\n      end\n    end\n\nSince this is an RSpec test you can run it using the operawatir binary, which is simply a shortcut for running tests: \n\n    % operawatir yellow_pages.rb\n\nEach block of code corresponds to a single named test case returning PASS or FAIL.  Whether you got back the expected and correct return value is evaluated with ``.should``.  If all tests pass, you will see the following output: \n\n    ..\n  \n    Finished in 2.04 seconds\n    2 examples, 0 failures\n\nIf anything fails, more information about each failure will be provided.\n\nYou can also see ``operawatir -h`` for more usage information:\n\n    Usage: operawatir [-m|--manual] [-l|--launcher=BINARY] [--binary=BINARY]\n           [-a|--args=ARGUMENTS] [-q|--no-quit] [--opera-idle] [-b|--backtrace]\n           [--no-color] [-t|--tag=TAG] [-f|--format=FORMAT] [-o|--out=FILE]\n           [-h|--help] [-v|--version] FILES\n    \n    Specific options:\n        -m, --manual                     Wait for a manual connection from opera:debug\n        -l, --launcher=BINARY            Path to launcher binary, will use environmental \n                                         variable OPERA_LAUNCHER if not specified\n            --binary=BINARY              Browser to run the test with, will use guess the \n                                         path or use environmental variable OPERA_PATH if \n                                         not specified\n        -a, --args=ARGUMENTS             Arguments passed to the binary, will override  \n                                         environmental variable OPERA_ARGS\n        -q, --no-quit                    Disable quitting of Opera at the end of a test run\n            --opera-idle                 Enable OperaIdle\n        -b, --backtrace                  Enable full backtrace\n            --no-color                   Disable colorized output\n        -t, --tag=TAG                    Specify tags to only run examples with the specified\n                                         tag, to exclude examples, add ~ before the tag (e.g.\n                                         `~slow')\n        -o, --out=FILE                   Send output to a file instead of STDOUT\n        -f, --format=FORMAT              Specify RSpec output formatter (documentation, \n                                         html, progress (default), textmate)\n    \n    Common options:\n        -h, --help                       Show this message\n       -v, --version                    Show version\n\n## Third-Party Libraries\n\nOperaWatir uses the following libraries:\n\n- [OperaDriver](http://www.opera.com/developer/tools/operadriver/) (Apache 2.0 License)\n- [rspec](https://github.com/rspec/rspec) (MIT License)\n- [jeweler](https://github.com/technicalpickles/jeweler) (MIT License)\n- [rake](https://github.com/jimweirich/rake) (MIT License)\n- [yard](https://github.com/lsegal/yard) (MIT License)\n- [mongrel](http://rubyforge.org/projects/mongrel) (Ruby License)\n- [sinatra](http://www.sinatrarb.com/) (MIT License)\n- [rr](http://rubyforge.org/projects/double-ruby) (MIT License)\n- [bluecloth](http://deveiate.org/projects/BlueCloth) (BSD License)\n- [clipboard](https://github.com/janlelis/clipboard) (MIT License)\n- [deprecated](https://github.com/erikh/deprecated) (BSD License)\n- [bundler](http://gembundler.com/) (MIT License)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperasoftware%2Foperawatir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foperasoftware%2Foperawatir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperasoftware%2Foperawatir/lists"}