| Description: An article on how watir helps Test | | | | 7. Running Automated test cases help to achieve |
| automation and power of Watir by implementing Ruby | | | | good test coverage |
| libraries | | | | Setting Up the Environment: |
| Introduction: | | | | The latest versions of Ruby 1.8.2 and Watir 1.6 and |
| I am using Watir for our product test automation and I | | | | install ruby using one-click installer. |
| want to share some of it's powerful features of | | | | Ruby libraries: |
| Watir. Testing a web based application using different | | | | Watir uses ruby libraries and I am sharing some of the |
| sets of data can be repeated task (Term called | | | | existed libraries:a. Network access, ftp, http, SMTP, |
| Regression testing). In this article we can walk through | | | | POPb. Test::Unitc. Database connectivityd. win 32 ole |
| how data driven tests can be performed and how the | | | | Ruby has access to the WIN32OLE library, which is |
| test results can be saved. | | | | basically like an API for windows applications. What |
| Picking a Automation Tool: | | | | you can do is use this library to catch these pop up |
| Automation team can choose the good tool for their | | | | windows. Below is the code that you'll have to add |
| test automation needs. There are many powerful tools | | | | and need to run in a Ruby script.require 'win32ole' - It |
| available in market which would be more costly. But | | | | loads the win32ole library in the Watir Test scripts. We |
| watir comes as Open source frame work to simulate | | | | need to include 'require' statement to the Watir library |
| all the browser activities. | | | | to load the Ruby test libraries. |
| First of all brief introduction of about WATIR features: | | | | Running a Watir test: |
| 1. Watir Stands for "Web Application Testing In Ruby" | | | | I am sharing below mentioned Watir examples: |
| 2. Open-source Framework for browser-based | | | | 1. How to automate the simple login scenario. |
| automated testing. | | | | 2. How to work with excel file (how to read the data |
| 3. Test scripts are written in the Ruby programming | | | | from Excel file) |
| language and Watir is a ruby library that simulate user | | | | 3. How to store the test results in log file. |
| action in the browsers. | | | | 4. How to work with outlook (how to send an email to |
| 4. It Supports all major browsers. (IE 6.0 and above | | | | other persons) |
| and Firefox 2.0 and above versions) | | | | 1. How to automate the simple login scenario:require |
| 5. Ideal for smoke and Regression testing (Automated | | | | "D:WATIRScriptLoglogger.rb"require "watir"require "test |
| test cases which are we need execute repeatedly) | | | | unit"require "win32ole"class TC_Login |
| 6. Ability to use the full power of Ruby in test scripts | | | | 'D:WATIRScriptLogfilename',:trunc => false) |
| .(Ruby is pure oops based languageand it has power | | | | $format = PatternFormatter.new( :pattern => "[%l] |
| to read the data from excel files and to write the data | | | | %d :: %m") |
| to excel files, xml files.) | | | | $file. |