Watir
{{short description|Open-source family of Ruby libraries}}
{{More citations needed|date=October 2012}}
{{Infobox software
| name = Watir
| logo = Watir.png
| screenshot =
| caption =
| developer = 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
| latest release version = 6.17
| latest release date = {{Start date and age|2020|08|28}}
| latest preview version =
| latest preview date =
| programming language = Ruby
| operating system = Cross-platform
| platform =
| genre = Software testing framework for web applications
| license = MIT license
| website = {{URL|http://watir.com/}}
}}
Watir (Web Application Testing in Ruby, pronounced water), is an open-source family of Ruby libraries for automating web browsers.{{cite web |url=http://watir.com/ |publisher=Watir |accessdate=11 October 2012 |title=Watir is...}}
- {{cite web|title=A new member in the Watir-family |url=http://www.opera.com/developer/tools/operawatir/ |publisher=Opera Software |archiveurl=https://web.archive.org/web/20110213011440/http://www.opera.com/developer/tools/operawatir/ |archivedate=13 February 2011 |accessdate=8 November 2023}}
- {{cite web |title=Watir to WebDriver: Unit Test Frameworks |url=https://www.facebook.com/notes/facebook-engineering/watir-to-webdriver-unit-test-frameworks/10150314152278920 |website=Facebook |accessdate=11 October 2012 |url-access=subscription}}{{cite book |first1=Lisa |last1=Crispin |first2=Janet |last2=Gregory |title=Agile Testing: A Practical Guide for Testers and Agile Teams|year=2008 |publisher=Addison-Wesley |isbn=9780321534460 |pages=172|url=https://books.google.com/books?id=68_lhPvoKS8C}} It drives Internet Explorer, Firefox, Chrome, Opera and Safari, and is available as a RubyGems gem.{{cite book |last=Marick |first=Brian |title=Everyday Scripting with Ruby: For Teams, Testers, and You |year=2007 |publisher=Pragmatic Programmer |isbn=9780977616619 |page=2 |url=https://books.google.com/books?id=1vKBQgAACAAJ |via=Google Books}} Watir was primarily developed by Bret Pettichord and Paul Rogers.
Functionality
{{Update section|date=April 2021}}
Watir project consists of several smaller projects. The most important ones are watir-classic, watir-webdriver and watirspec.
= Watir-Classic =
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.{{cite web |title=Creating automated test scripts with Ruby and WATIR |url=http://www.thoughtworks.com/articles/automated-testing-using-ruby-and-watir |publisher=ThoughtWorks |first=Jeremy |last=Suarez |date=16 September 2010|accessdate=11 October 2012}} Watir-Classic operates differently to 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 =
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 =
Watirspec is executable specification of the Watir API, like RubySpec is for Ruby.
See also
{{Portal|Free and open-source software}}
References
{{Reflist}}
External links
- [https://watir.github.io Watir home page]
- [https://github.com/watir/ Watir source code]
- [https://soundcloud.com/the-watir-podcast The Watir Podcast]
- [https://leanpub.com/cucumber_and_cheese Cucumber & Cheese] {{Webarchive|url=https://web.archive.org/web/20131207093900/https://leanpub.com/cucumber_and_cheese |date=2013-12-07 }}, a testers' workshop book by Jeff Morgan
Category:Graphical user interface testing
Category:Ruby (programming language)