Last two days I spent my time on Watir (Pronounced “Water”) testing tool. It’s open source functional testing tool, means totally free to use and you can download this testing tool from here- Watir But like other testing tools it has some dependencies like it uses Ruby scripting language, IE browser and runs only on Windows. So to use Watir you must install Ruby on your system. It does not support other browsers like Firefox, Mozilla, and others. Watir is totally different from other testing tools like WinRunner, QTP and others because it does not support Recording and Playback concept. Now one question is ommited over here that how we can test our web application? So answer is that we can write test script in Notepad in Ruby scripting language and save with .rb extension and run this file through command prompt.

If you want to install Ruby or Watir testing tool then go to this link-

Today I have written one basic script for Watir, which is given below. If you trying to understand that where we can start then follow this script.

# the watir controller

require ‘watir’

# Open one new IE browser

# Define one variable


# Put the website address in Address Bar browser.goto(test_site)

So this is very small script for opening site. If you want to run with Watir then it’s very necessary that you should learn some basics of Ruby.

Here I’m describing how this script works behind the window.

require ‘Watir’ If you want to use Watir testing tool then first type this syntax at the beginning of the script. This syntax allows our test script to use Watir testing tool.

test_site=” abc is simple variable which is having one URL. In Ruby every variable start with small latter. browser is also simple variable. This syntax tells Watir tool that open one new IE browser.

.new is Method (Please go through Ruby).

browser.goto(test_site) this syntax will tell Watir that put the abc contain URL on the address bar.

.goto is also Method.

So this is description about one small Watir script. I’ll come with further discussions and welcome your questions and suggestions.


5 thoughts on “Watir

  1. hi bhaiya,
    Thanks for it. i don’t have any knowledge about testing tools before that but now after reading this blog i have understood that what realy it does.
    give me some more information about that.
    waiting for your reply.

  2. As you mentioned “It does not support for FirFox, Mozilla and other” but I checked Its supported for those browsers…
    Please let me know support for other lanuages…
    but I like your synatx

  3. Hi

    my self vinay. I’m working on “watir” tool for testing web application. I’m finding it difficult to handle popups i tired all the things i could get in google search but i didnt get any solution so kindly request you to suggest me some solution on how to write scripts for handling various kinds of popups.


  4. Hi all,

    I am learning RUBY for the past 15 days, i want to test a web application using a watir.I have installed ruby ,then i Installed Watirrecorder++ for recording the website.when i click on play backoption after recording I am not able to capture all the mouse movement could u please help me.

    Thank & Regards,

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s