Subscribe by Email

Wednesday, January 30, 2013

Explain Watir - Web Application Testing in Ruby?

Watir stands for web application testing in Ruby and was developed as an open source that would provide Ruby libraries by Paul Rogers and Bret Pettichord. The software is licensed under BSD and contains all ruby libraries that would be required for the automation of the web browsers. The software is known to drive a number of web browsers namely:
  1. Internet explorer
  2. Mozilla firefox
  3. Chrome
  4. Opera
  5. Safari
The software has been made available especially for ruby as the ruby gems. Watir is comprised of several smaller projects which define its functionality:
1.Watir – Classic: Ruby has got built – in OLE capabilities that can be used by watir classic for driving the IE pro grammatically. The way of operation of watir classic is different than that of the other HTTP based testing tools.
2.Watirspec: This one is watir’s executable specification.
3.Watir–web driver: The reference implementation of the web-driver specification is the selenium 2.0. the roots of the watir web driver can be traced to the HTML specification.

This automated test tool uses Ruby as the scripting language for driving the above mentioned web browsers. You can call it a tool kit for developing effective automated tests and run them against the browsers. Watir can be used for driving the web applications which can be looked up as HTML pages while browsing. 
However, Watir is not known to work with the following:
  1. Active X plug – in components
  2. Java applets
  3. Macromedia flash and other plug – in applications.
Before you use Watir for your application you need to determine whether it will work for it or not. To do so just right click on the object and check for the view source menu. If the HTML source for the object is available it can be well automated using watir otherwise not. There are certain prerequisites for using Watir which are that you need to have knowledge about the following:
  1. HTML
  2. Programming basics including simple control structures.
  3. Ruby: this is required if you put watir to a really good use.
Watir works well for all the windows platforms including Windows 2000, server 2003, XP and vista and it can be run on versions 6 and 7 of internet explorer. Using ruby 1.8.5 – 24 or 1.8.6 – 26 is recommended. For installing ruby and watir you need to log on as the administrator. 
There are two ways for installing Watir:
  1. From behind a proxy and
  2. From behind a firewall
The tests written using Watir are quite easy to read as well as maintain and exhibit simplicity and flexibility. The way Watir drives the web browsers is the same as done by people. It performs clicking operations such as clicking on links and buttons, forms filling operations and so on. Results are also checked by Watir. 
Ruby, like other programming languages provides your application with the ability to do the following:
  1. To connect to data bases
  2. To read from spreadsheets and data files
  3. To export the XML files
  4. To restructure your code so that it can be converted in to a reusable library.
Watir is free open source tool and therefore no money expenditure in using it. Ruby is a full featured modern programming language which lets Watir support all the web applications no matter by what technology it has been developed. Watir provides support to a number of browsers on different platforms. Though the tool is quite powerful it is extremely simple and easy to use. For using Watir it is recommended that you install the IE developer tool bar. 

No comments:

Facebook activity