Watir ( Web Application Testing in Ruby), is an open source tool for automation testing of web application that uses Ruby libraries. Current Watir versions support cross browser testing for most of common browsers: Chrome, Safari, Firefox, IE, headless browsers and Opera. It is available as a RubyGems gem, supports data-driven testing and is integrated with BDD tools such as RSpec, Cucumber and Test / Unit. It's also free which is always nice.
When Watir was buit it generally consisted of three smaller projects, each dedicated to a specific purpose. The key ones are watir-classic, watirspec and watir-webdriver.
As Watir was originally designed for IE automation, it makes use of built-in Ruby Object Linking and Embedding (OLE, a technology made by Microsoft that allows linking and embedding documents and other objects) capabilities. Watir-classic is made to drive Internet Explorer. It operates in a way different from HTTP-based automation testing tools which simulate a specific browser.Watir-classic drives IE directly through OLE protocol that is made using the Component Object Model (COM) architecture.Watir-Classic is supported on Ruby 1.8.7, 1.9.3 and 2.0.0. It should work on Internet Explorer 8, 9 and 10.To install the gem from the command line run “gem install watir-classic” which is Ruby’s way of packaging code.
Watir-webdriver is a reworked version of Watir API that is based on Selenium Webdriver. Selenium 2.0 is more of a reference implementation of the WebDriver specification. For Ruby Watir API is implemented as a wrapper around the Selenium 2.0 API.Currently all of the watir-webdriver code has been moved into the watir gem. The future of Watir is using the W3C specification for browser automation, and that means basing the active implementation of Watir on Selenium.
Watirspec is executable specification of the Watir API, like RubySpec is for Ruby. Specs specific to Watir are found in spec/*_spec.rb, with watirspec in spec/watirspec/.
The latest available Watir version is 6.10. In incorporates all above projects into one gem which is installed simply by gem install watir and features improvements in behaviour of locating elements by text, custom attributes that are no longer limited by valid HTML5 attributes (which means that you can now locate custom Angular elements without needing to use watir_angular, and can locate various div and span elements that (incorrectly) use the name attribute) and changes in the way of interpretation Selenium locators without any XPath conversion where it is possible.
- Its free and open source, you can use it however you want and adjust to your needs.
- Flexible for functional testing tool for automating browser-based tests of web applications.
- There is a growing community of users, which means you will most likely easily find help if you need it.
- It uses Ruby, which is one of the most popular scripting languages nowadays.
- It supports multiple browsers on different platforms.
- Watir is a family of Ruby libraries but it supports all other technologies.
DeviQA`s automation testing teams has written millions of lines of code and thousands of test suites in Ruby using almost all known and up to date automation tools that0 are available on the market, including Watir. Contact us if you need automation testing on Ruby, we are ready to go as soon as you are!