Benefits - SiliconIndia

tunisianbromidrosisInternet and Web Development

Feb 5, 2013 (4 years and 6 months ago)

110 views

Nov 13
th

, 2010

Building an Automation Framework

Using Watir (Open Source Tool)

Aashu Chandra

Head of QA and Testing Practice, Infogain

-

2

-

Copyright Infogain Corporation, 2010

Agenda


Benefits of Testing Framework


Why Watir?


Block diagram of Testing Framework


Key Features of Testing Framework


Summary

-

3

-

Copyright Infogain Corporation, 2010

Benefits of Testing Framework


Reduces effort to automate
script


Easy to maintain


Consistent error/exception
handling mechanism


Less dependence on highly
skilled automation engineers

-

4

-

Copyright Infogain Corporation, 2010

Why Watir?


Free open source tool


Supports IE, FireFox, Chrome, Safari (for Mac)


Uses Ruby programming language


Supports web applications developed using different technologies


Waits for complete page download, before starting with next test action


Ability to recognize objects using various HTML properties


Refer
www.watir.com

for details

-

5

-

Copyright Infogain Corporation, 2010

Block Diagram of Watir based testing framework

-

6

-

Copyright Infogain Corporation, 2010

Key Features of Watir based testing framework


Re
-
usability


Business Scenario’s


Plug n Play


Automated publishing of Test Results


Error/Exception handling


Test Coverage tracking


Parallel run on multiple machines




-

7

-

Copyright Infogain Corporation, 2010

Reusability


Identify re
-
usable technical and business functions


Stored in well structured and well documented libraries

Benefits


Consistent testing due to use of reusable

existing functions


Write once, use many

-

8

-

Copyright Infogain Corporation, 2010

Reusability: Example

Libraries

Description

Example

Tool Function Library

Re
-
usable functions that
comes built
-
in with the tools

Screen_capture,

getStaticTextFromWindow,

clickJavascriptDialog

Application
Independent
Technical Function
Library

Re
-
usable functions that have
been compiled by Infogain

DbConnect, SendMail,
ReadExcelFile, WriteExcelFile

Application Specific
Technical Functions
Library

Commonly used technical or
basic functions that the
application under test uses

LogIntoApplication,
GoToHomePage,
GoToCatalogModule,
SetUserPreference.

-

9

-

Copyright Infogain Corporation, 2010

Business scenario’s
-

Plug n Play


Plug n Play mechanism to build new business
scenario’s using existing functions


Create new test scripts based on common business
entities and operations


For Example:


PutBookInShoppingCart(BookId)


RemoveBookFromShoppingCart(BookId)


CheckOutShoppingCart()

Benefits


Quick development of an automated test script to test
some specific scenarios


-

10

-

Copyright Infogain Corporation, 2010

Automated Publishing of Test Results


Automated framework collects and publishes test results


Notifies users of test completion via email with attached test results


Report at


Test suite level


Test step level

Benefits


Automated process keeps system and team up to date on app
development and testing


Can drill down to test step to identify the reason for failure of test
case

-

11

-

Copyright Infogain Corporation, 2010

Sample: Test Script Level results

-

12

-

Copyright Infogain Corporation, 2010

Sample: Test Step Level results

-

13

-

Copyright Infogain Corporation, 2010


Screen capture when a failure happens


Provide Stack trace when an exception happens. This helps in
detailed analysis

Benefits


Screen capture helps convincing developers about the bug


Stack trace helps in faster trouble shooting

Error/Exception handling

-

14

-

Copyright Infogain Corporation, 2010

Test Coverage Tracking


Integrated with code coverage tools


Perl


Devel::Cover
(For details refer
http://search.cpan.org/dist/Devel
-
Cover )


Java


Emma
(For details refer
http://emma.sourceforge.net )

Benefits


Get the coverage for any test run


Helps identify which are the areas which are not well covered

-

15

-

Copyright Infogain Corporation, 2010

Parallel runs on multiple machines


Automation manager helps in configuring test cases to be run on
different machines


For example 300 test cases


took almost 18 hours on one

machine


Now takes 6 hours on 4 machines

Benefits


Reduces test execution time

-

16

-

Copyright Infogain Corporation, 2010

Summary



Open Source testing tools like Watir is powerful and supports most of the
web applications


Testing Framework built over Watir helps in


Speeding up automation of scripts


Reduces dependence on highly skilled automation engineers


Quickly test new business scenario’s using

existing building blocks


Provides detailed inputs to developer

during error/exception


Reduces execution elapsed time, by

performing parallel runs


Integrates with Code coverage tools



Aashu Chandra

Head of QA and Testing Practice, Infogain

aashu.chandra@infogain.com