Last updated
Developer(s) Bret Pettichord, Charley Baker, Angrez Singh, Jari Bakken, Jarmo Pertman, Hugh McGowan, Andreas Tolf Tolfsen, Paul Rogers, Dave Hoover, Sai Venkatakrishnan, Tom Copeland, Alex Rodionov, Titus Fortner
Stable release
6.7.2 / August 18, 2017;23 months ago (2017-08-18)
Written in Ruby
Operating system Cross-platform
Type Software testing framework for web applications
License MIT license
Website watir.com

Watir (Web Application Testing in Ruby, pronounced water), is an open-source family of Ruby libraries for automating web browsers. [1] [2] [3] [4] It drives Internet Explorer, Firefox, Chrome, Opera and Safari, and is available as a RubyGems gem. [4] [5] Watir was primarily developed by Bret Pettichord and Paul Rogers.

Ruby is an interpreted, high-level, general-purpose programming language. It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

Internet Explorer web browser developed by Microsoft

Internet Explorer is a series of graphical web browsers developed by Microsoft and included in the Microsoft Windows line of operating systems, starting in 1995. It was first released as part of the add-on package Plus! for Windows 95 that year. Later versions were available as free downloads, or in service packs, and included in the original equipment manufacturer (OEM) service releases of Windows 95 and later versions of Windows. The browser is discontinued, but still maintained.

Google Chrome Web browser developed by Google

Google Chrome is a cross-platform web browser developed by Google. It was first released in 2008 for Microsoft Windows, and was later ported to Linux, macOS, iOS, and Android. The browser is also the main component of Chrome OS, where it serves as the platform for web apps.



Watir project consists of several smaller projects. The most important ones are watir-classic, watir-webdriver and watirspec.


Watir-classic makes use of the fact that Ruby has built in Object Linking and Embedding (OLE) capabilities. As such it is possible to drive Internet Explorer programmatically. [6] Watir-classic operates differently than HTTP based test tools, which operate by simulating a browser. Instead Watir-classic directly drives the browser through the OLE protocol, which is implemented over the Component Object Model (COM) architecture.

Object Linking & Embedding (OLE) is a proprietary technology developed by Microsoft that allows embedding and linking to documents and other objects. For developers, it brought OLE Control Extension (OCX), a way to develop and use custom user interface elements. On a technical level, an OLE object is any object that implements the IOleObject interface, possibly along with a wide range of other interfaces, depending on the object's needs.

Component Object Model (COM) is a binary-interface standard for software components introduced by Microsoft in 1993. It is used to enable inter-process communication object creation in a large range of programming languages. COM is the basis for several other Microsoft technologies and frameworks, including OLE, OLE Automation, Browser Helper Object, ActiveX, COM+, DCOM, the Windows shell, DirectX, UMDF and Windows Runtime. The essence of COM is a language-neutral way of implementing objects that can be used in environments different from the one in which they were created, even across machine boundaries. For well-authored components, COM allows reuse of objects with no knowledge of their internal implementation, as it forces component implementers to provide well-defined interfaces that are separated from the implementation. The different allocation semantics of languages are accommodated by making objects responsible for their own creation and destruction through reference-counting. Type conversion casting between different interfaces of an object is achieved through the QueryInterface method. The preferred method of "inheritance" within COM is the creation of sub-objects to which method "calls" are delegated.

The COM permits interprocess communication (such as between Ruby and Internet Explorer) and dynamic object creation and manipulation (which is what the Ruby program does to the Internet Explorer). Microsoft calls this OLE automation, and calls the manipulating program an automation controller. Technically, the Internet Explorer process is the server and serves the automation objects, exposing their methods; while the Ruby program then becomes the client which manipulates the automation objects.


Watir-webdriver is a modern version of the Watir API based on Selenium. Selenium 2.0 (selenium-webdriver) aims to be the reference implementation of the WebDriver specification. In Ruby, Jari Bakken has implemented the Watir API as a wrapper around the Selenium 2.0 API. Not only is Watir-webdriver derived from Selenium 2.0, it is also built from the HTML specification, so Watir-webdriver should always be compatible with existing W3C specifications.

Selenium is a portable framework for testing web applications. Selenium provides a playback tool for authoring functional tests without the need to learn a test scripting language. It also provides a test domain-specific language (Selenese) to write tests in a number of popular programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. The tests can then run against most modern web browsers. Selenium deploys on Windows, Linux and macOS platforms. It is open-source software, released under the Apache 2.0 license: web developers can download and use it without charge.

HTML Hypertext Markup Language

Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.


Watirspec is executable specification of the Watir API, like RubySpec is for Ruby.

The RubySpec project aimed to write a complete executable specification for the Ruby programming language. This project contains specs that describe Ruby language syntax and standard library classes. The project contains two main components:

See also

Acceptance testing

In engineering and its various subdisciplines, acceptance testing is a test conducted to determine if the requirements of a specification or contract are met. It may involve chemical tests, physical tests, or performance tests.

Regression testing is re-running functional and non-functional tests to ensure that previously developed and tested software still performs after a change. If not, that would be called a regression. Changes that may require regression testing include bug fixes, software enhancements, configuration changes, and even substitution of electronic components. As regression test suites tend to grow with each found defect, test automation is frequently involved. Sometimes a change impact analysis is performed to determine an appropriate subset of tests.

In software testing, test automation is the use of software separate from the software being tested to control the execution of tests and the comparison of actual outcomes with predicted outcomes. Test automation can automate some repetitive but necessary tasks in a formalized testing process already in place, or perform additional testing that would be difficult to do manually. Test automation is critical for continuous delivery and continuous testing.

Related Research Articles

This article compares HTML support by several browser engines.

Microsoft Active Accessibility (MSAA) is an Application Programming Interface (API) for user interface accessibility. MSAA was introduced as a platform add-on to Microsoft Windows 95 in 1997. MSAA is designed to help Assistive Technology (AT) products interact with standard and custom user interface (UI) elements of an application, as well as to access, identify, and manipulate an application's UI elements. AT products work with MSAA enabled applications in order to provide better access for individuals who have physical or cognitive difficulties, impairments, or disabilities. Some examples of AT products are screen readers for users with limited sight, on screen keyboards for users with limited physical access, or narrators for users with limited hearing. MSAA can also be used for automated testing tools, and computer-based training applications.

Silk Test is a tool for automated function and regression testing of enterprise applications. It was originally developed by Segue Software which was acquired by Borland in 2006. Borland was acquired by Micro Focus International in 2009.

In Microsoft Windows applications programming, OLE Automation is an inter-process communication mechanism created by Microsoft. It is based on a subset of Component Object Model (COM) that was intended for use by scripting languages – originally Visual Basic – but now is used by several languages on Windows. All automation objects are required to implement the IDispatch interface. It provides an infrastructure whereby applications called automation controllers can access and manipulate shared automation objects that are exported by other applications. It supersedes Dynamic Data Exchange (DDE), an older mechanism for applications to control one another. As with DDE, in OLE Automation the automation controller is the "client" and the application exporting the automation objects is the "server".

WET Web Tester is a web testing tool that drives an IE Browser directly and so the automated testing done is equivalent to how a user would drive the web pages. The tool allows a user to perform all the operations required for testing web applications – like automatically clicking a link, entering text in a text field, clicking a button etc. One may also perform various checks as a part of the testing process by using Checkpoints. The latest version of WET is 1.0.0.

Ranorex Studio

Ranorex Studio is a GUI test automation framework provided by Ranorex GmbH, a software development company. The framework is used for the testing of desktop, web-based and mobile applications.

iMacros imacros

iMacros is a browser based application for macro recording, editing and playback for web automation and testing. It is provided as a standalone application and extensions for the Mozilla Firefox, Google Chrome, and Internet Explorer web browsers. Developed by iOpus/Ipswitch, It adds record and replay functionality similar to that found in web testing and form filler software. The macros can be combined and controlled via JavaScript. Demo macros and JavaScript code examples are included with the software. Running strictly JavaScript based macros were removed in later versions of iMacros browser extensions. However, users can use alternative browser like Pale Moon, based on older version of Mozilla Firefox to use JavaScript files for web based automated testing with Moon Tester Tool.

GUI testing tools serve the purpose of automating the testing process of software with graphical user interfaces.

Cappuccino is an open source application development framework for developing web applications that look and feel like desktop applications on Mac OS X. Cappuccino was developed by University of Southern California graduates Francisco Tolmasky, Tom Robinson and Ross Boucher, who are also the founders of 280 North, Inc. It is primarily targeted towards web applications developers.


TestComplete is a functional automated testing platform developed by SmartBear Software. TestComplete gives testers the ability to create automated tests for Microsoft Windows, Web, Android, and iOS applications. Tests can be recorded, scripted or manually created with keyword driven operations and used for automated playback and error logging.

The W3C Geolocation API is an effort by the World Wide Web Consortium (W3C) to standardize an interface to retrieve the geographical location information for a client-side device. It defines a set of objects, ECMAScript standard compliant, that executing in the client application give the client's device location through the consulting of Location Information Servers, which are transparent for the application programming interface (API). The most common sources of location information are IP address, Wi-Fi and Bluetooth MAC address, radio-frequency identification (RFID), Wi-Fi connection location, or device Global Positioning System (GPS) and GSM/CDMA cell IDs. The location is returned with a given accuracy depending on the best location information source available.

Twist is a test automation and functional testing solution built by Thoughtworks Studios, the software division of ThoughtWorks. It uses Behavior Driven Development (BDD) and Test-driven development (TDD) for functional testing of the application. It is a part of the Adaptive ALM solution consisting of Twist for Agile testing by ThoughtWorks Studios, Mingle for Agile project management and Go for Agile release management.

Maveryx is a cross-platform GUI Test Automation Framework developed by Maveryx Srl. This Framework provides functional UI, regression, data-driven, and keyword-driven testing capabilities to test a wide range of Desktop and Web technologies. Maveryx Test Automation Framework allows testing many different GUI technologies. Unlike other testing tools, Maveryx does not need recordings, code instrumentation, GUI Maps or Object Repositories to create and run automated tests.

Cucumber is a software tool used by computer programmers that supports behavior-driven development (BDD). Central to the Cucumber BDD approach is its plain language parser called Gherkin. It allows expected software behaviors to be specified in a logical language that customers can understand. As such, Cucumber allows the execution of feature documentation written in business-facing text. It is often used for testing other software. It runs automated acceptance tests written in a behavior-driven development (BDD) style.

Robot Framework open source test automation software for acceptance testing

The Robot Framework is a generic test automation framework for acceptance testing and acceptance test-driven development (ATDD). It is a keyword-driven testing framework that uses tabular test data syntax.

Capybara is a web-based test automation software that simulates scenarios for user stories and automates web application testing for behavior-driven software development. It is written in the Ruby programming language.

Flood IO is a load testing platform that executes globally-distributed performance tests from open source tools, including JMeter, Gatling, and Selenium. It also runs test plans written with Ruby JMeter, an open source RubyGem.

Katalon Studio free automation testing solution developed by Katalon LLC

Katalon Studio is a free automation testing solution developed by Katalon LLC. The software is built on top of the open-source automation frameworks Selenium, Appium with a specialized IDE interface for API, web and mobile testing. Its first public release was in September 2016. In 2018, the software acquired for 9% of market penetration for UI test automation, according to The State of Testing 2018 Report by SmartBear.


  1. "Watir home page". Watir web site. Retrieved 11 October 2012.
  2. "A new member in the Watir-family". Opera Software web site. Opera Software. Retrieved 11 October 2012.
  3. "Watir to WebDriver: Unit Test Frameworks". Facebook Engineering's Notes. Facebook. Retrieved 11 October 2012.
  4. 1 2 Crispin, Gregory (2008). Agile Testing: A Practical Guide for Testers and Agile Teams. Addison-Wesley. p. 172. ISBN   9780321534460.
  5. Marick, Brian (2007). Everyday Scripting with Ruby: For Teams, Testers, and You. Pragmatic Bookshelf. p. 2. ISBN   9780977616619.
  6. "Creating automated test scripts with Ruby and WATIR". ThoughtWorks web site. ThoughtWorks. Retrieved 11 October 2012.