Watir

Last updated
Watir
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.17 / August 28, 2020;3 years ago (2020-08-28)
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] It drives Internet Explorer, Firefox, Chrome, Opera and Safari, and is available as a RubyGems gem. [2] [3] Watir was primarily developed by Bret Pettichord and Paul Rogers.

Contents

Functionality

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. [4] 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

Related Research Articles

<span class="mw-page-title-main">Acceptance testing</span> Test to determine if the requirements of a specification or contract are met

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.

<span class="mw-page-title-main">Document Object Model</span> Convention for representing and interacting with objects in HTML, XHTML, and XML documents

The Document Object Model (DOM) is a cross-platform and language-independent interface that treats an HTML or XML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree; with them one can change the structure, style or content of a document. Nodes can have event handlers attached to them. Once an event is triggered, the event handlers get executed.

Software testing is the act of examining the artifacts and the behavior of the software under test by validation and verification. Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software implementation. Test techniques include, but are not necessarily limited to:

<span class="mw-page-title-main">ActiveX</span> Software framework by Microsoft introduced in 1996

ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide Web. Microsoft introduced ActiveX in 1996. In principle, ActiveX is not dependent on Microsoft Windows operating systems, but in practice, most ActiveX controls only run on Windows. Most also require the client to be running on an x86-based computer because ActiveX controls contain compiled code.

JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer web browser.

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.

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.

Selenium is an open source umbrella project for a range of tools and libraries aimed at supporting browser automation. It provides a playback tool for authoring functional tests across most modern web browsers, 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 JavaScript (Node.js), C#, Groovy, Java, Perl, PHP, Python, Ruby and Scala. Selenium runs on Windows, Linux, and macOS. It is open-source software released under the Apache License 2.0.

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, 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.

QF-Test from Quality First Software is a cross-platform software tool for the GUI test automation specialized on Java/Swing, SWT, Eclipse plug-ins and RCP applications, Java applets, Java Web Start, ULC and cross-browser test automation of static and dynamic web-based applications. Version 4.0 added Windows support for the Web browser Chrome, support for JavaFX and the AJAX frameworks jQuery UI and jQueryEasyUI were added.

iMacros Browser-based application for macro recording, editing and playback

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 extension for 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 was removed in later versions of iMacros browser extensions. However, users can use alternative browser like Pale Moon, based on older versions of Mozilla Firefox to use JavaScript files for web-based automated testing with Moon Tester Tool.

<span class="mw-page-title-main">Micro Focus Unified Functional Testing</span>

Micro Focus Unified Functional Testing (UFT), formerly known as QuickTest Professional (QTP), is software that provides functional and regression test automation for software applications and environments.

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

<span class="mw-page-title-main">TestComplete</span> Software test automation tool

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.

API testing is a type of software testing that involves testing application programming interfaces (APIs) directly and as part of integration testing to determine if they meet expectations for functionality, reliability, performance, and security. Since APIs lack a GUI, API testing is performed at the message layer. API testing is now considered critical for automating testing because APIs now serve as the primary interface to application logic and because GUI tests are difficult to maintain with the short release cycles and frequent changes commonly used with Agile software development and DevOps.

Specification by example (SBE) is a collaborative approach to defining requirements and business-oriented functional tests for software products based on capturing and illustrating requirements using realistic examples instead of abstract statements. It is applied in the context of agile software development methods, in particular behavior-driven development. This approach is particularly successful for managing requirements and functional tests on large-scale projects of significant domain and organisational complexity.

A headless browser is a web browser without a graphical user interface.

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.

<span class="mw-page-title-main">Katalon Studio</span> Automation testing software tool

Katalon Platform is an automation testing software tool developed by Katalon, Inc. The software is built on top of the open-source automation frameworks Selenium, Appium with a specialized IDE interface for web, API, mobile and desktop application testing. Its initial release for internal use was in January 2015. Its first public release was in September 2016. In 2018, the software acquired 9% of market penetration for UI test automation, according to The State of Testing 2018 Report by SmartBear.

References

  1. "Watir is..." Watir. Retrieved 11 October 2012.
    - "A new member in the Watir-family". Opera Software. Archived from the original on 13 February 2011. Retrieved 8 November 2023.
    - "Watir to WebDriver: Unit Test Frameworks" . Facebook. Retrieved 11 October 2012.
  2. 1 2 Crispin, Lisa; Gregory, Janet (2008). Agile Testing: A Practical Guide for Testers and Agile Teams. Addison-Wesley. p. 172. ISBN   9780321534460.
  3. Marick, Brian (2007). Everyday Scripting with Ruby: For Teams, Testers, and You. Pragmatic Programmer. p. 2. ISBN   9780977616619 via Google Books.
  4. Suarez, Jeremy (16 September 2010). "Creating automated test scripts with Ruby and WATIR". ThoughtWorks. Retrieved 11 October 2012.