|This article needs additional citations for verification. (October 2012)|
|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|
|Stable release||5.0 / October 5, 2013|
|Written in||Ruby (programming language)|
|Type||software testing framework for web applications|
Watir (Web Application Testing in Ruby, pronounced water), is an open-source (BSD) family of Ruby libraries for automating web browsers. It drives Internet Explorer, Firefox, Chrome, Opera and Safari, and is available as a RubyGems gem. Watir was primarily developed by Bret Pettichord and Paul Rogers.
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. 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.
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.
Watirspec is executable specification of the Watir API, like RubySpec is for Ruby.
- Celerity is similar to Watir, but emulates a browser instead of driving a real browser.
- Vapir // is a Watir fork with bug fixes, API changes and new functionality.
- WatiN (pronounced What-in) stands for Web Application Testing In .NET. It is similar to Watir, but is implemented in .NET Framework.
- Watij (pronounced wattage) stands for Web Application Testing in Java. It is similar to Watir, but implemented in Java.
- Win32::Watir is similar to Watir, but implemented in Perl.
- win-control is similar to Watir, but implemented in Gambit (Scheme implementation).
- Selenium (software) is a portable software testing framework for web applications.
- iMacros is similar to Watir, but includes visual recording, web scraping support and a COM object for use with any programming language (Windows only)
- Watir for Rails library for using Watir with Rails.
- "Watir home page". Watir web site. Retrieved 11 October 2012.
- "A new member in the Watir-family". Opera Software web site. Opera Software. Retrieved 11 October 2012.
- "Watir to WebDriver: Unit Test Frameworks". Facebook Engineering's Notes. Facebook. Retrieved 11 October 2012.
- Crispin, Gregory (2008). Agile Testing: A Practical Guide for Testers and Agile Teams. Addison-Wesley. p. 172. ISBN 9780321534460.
- Marick, Brian (2007). Everyday Scripting with Ruby: For Teams, Testers, and You. Pragmatic Bookshelf. p. 2. ISBN 9780977616619.
- "Creating automated test scripts with Ruby and WATIR". ThoughtWorks web site. ThoughtWorks. Retrieved 11 October 2012.