Paper Automation Regression Testing
Paper Automation Regression Testing
AU T O M AT E D
REGRESSION TESTING
F R A M E WO R K
A W HITE PAPER
BY
N G NANASEKARAN
V INEET B ANGA
(NIIT T ECHNOLOGIES LTD.)
nd
July 02 , 2007 Page 1 of 19
Automated Regression Testing Framework
Table of Contents
1. INTRODUCTION 3
1. Approach 4
2. Architecture 4
6. Report Design/Template 9
7. Templates 10
3. TESTING PROCESS 14
4. OTHER DETAILS 17
5. SUMMARY 18
nd
July 02 , 2007 Page 2 of 19
Automated Regression Testing Framework
1. Introduction
There has been many automated software testing process existing and being
developed by huge number of testing professional. Automated testing slowly
becoming a necessity as the demand for low turn around time and high quality.
There are different regression testing tools (Win runner, Robot, QA Run) based
on GUI and type of application (Client Server, Web application). The major focus
or issue lies in implementation of these off the shelf product in a customized
way. This approach is one step in the direction of recording and allows you to
create test cases. It provides a guide to write test cases in a customized way. It
uses the keyword and commands generated based on event triggered on each
field, form, page in the application. This is one of a cost effective approach for
automated testing solution.
nd
July 02 , 2007 Page 3 of 19
Automated Regression Testing Framework
The Regression Testing framework is based on the “Test Plan Driven” method
(a.k.a “Key-word driven). In this method, the entire process is data-driven,
including the functionality. The Actions/Methods (keywords) control the
processing. In this approach a web interface is used to generate the test plan
and test cases. Which are then stored in the form of tables in a Database.
2. Architecture
nd
July 02 , 2007 Page 4 of 19
Automated Regression Testing Framework
Controller Script
(Excel File)
Driver
Script
Input utility
Business Functions Script
Action utility
Verify utility
1. Driver Script: The Driver script is the main startup script. It performs
initialization and then calls the Controller Script.
2. Controller Script: The Controller script calls the Generic scripts associated
with Business function to perform the Test Case actions and verifications.
3. Business Function Script: The Business Function script would perform the
following tasks:
nd
July 02 , 2007 Page 5 of 19
Automated Regression Testing Framework
nd
July 02 , 2007 Page 6 of 19
Automated Regression Testing Framework
Using SQL Server as database a Web Interface(PHP) is created that stored and
retrieved the test plans / test cases details from the database. The Web
Interface provides the following benefits:
A Web Interface (using PHP and PEAR) created to maintain test plan / test
case in SQL Server tables. This application will be invoked from web browser
e.g. Internet Explorer.
nd
July 02 , 2007 Page 7 of 19
Automated Regression Testing Framework
While creating a Test Case/ Test Plan’, following SQL Server tables will be
updated respectably:
• Test Case
[TESTCASES]
[TESTCASEDETAILS] - a new table for Test Case’s information
[TESTENTITYHISTORY]
[TESTCASEDENDENCIES]
nd
July 02 , 2007 Page 8 of 19
Automated Regression Testing Framework
• Test Plan
[TESTPLANS]
[TESTPLANDETAILS] - a new table for Test Plan’s information
[TESTENTITYHISTORY]
6. Report Design/Template
The following figure presents the schema design to support the results of the
Reporting framework.
nd
July 02 , 2007 Page 9 of 19
Automated Regression Testing Framework
7. Templates
Test Plan
The Test plan is used to determine the sequence of the top-level test scenarios or
test cases, which need to be executed. The figure given below presents the
sample test plan and describes the various columns available in the test plan.
Each row in the test plan documents a test case/scenario, which is specified by
the name of the Business Function test case.
Description of Test Plan Version No. Of Test Plan Creation/Modification date Developer Id
The business function test case template is a generic test case template,
which can be used to prepare automated data-driven test case for any test
scenario. The figure given below presents the sample test case. The figure also
nd
July 02 , 2007 Page 10 of 19
Automated Regression Testing Framework
describes the various columns available in the generic business function test
case. Each row in the Business Function script contains an action/method, which
needs to be executed by the script. Along with the action/method, the row
contains information about the window and field on which the action has to be
executed and the corresponding value on which it needs to act upon.
Specifies the Specifies the sub- Specifies the Specifies the brief
window name on Field (Label) name Method/action, description of the
which the action internal DataWidnow which needs to be Test Case
needs to be column on which the performed.
performed action needs to be
f d
Specifies the field Specifies the row in case of a table, for Specifies the value, which needs to be
name on which the which data needs to be input/verified. input/verified
action needs to be Specify 0 (Zero) to work with current • String should be left aligned.
performed selected row. • Numeric should be number.
Description of Test Case Version No. of Test Case Creation/Modification date Developer Id
This section describes how the Regression Testing framework would work.
The following are the sequence of steps that would be carried out when the
framework would be used to carry out regression testing:
nd
July 02 , 2007 Page 11 of 19
Automated Regression Testing Framework
• The Driver script (TSL script) would first be loaded and executed. The
Driver script would carry out the necessary initializations for the
framework, Reporting framework. The Driver scripts would read test plans
name and then would pass each test plan to controller script for further
execution.
• The Controller script (TSL script) controls the sequence of execution of the
test cases/scenarios through an associated test plan/data. The test plan is
created in an excel spreadsheet or using the web interface. Each row in the
test plan documents a test case/scenario, which is specified by the name
nd
July 02 , 2007 Page 12 of 19
Automated Regression Testing Framework
nd
July 02 , 2007 Page 13 of 19
Automated Regression Testing Framework
The user can specify the sequence of steps to traverse through the entire
application in a test case (as per the existing test case template). Besides
containing the sequence of steps for traversing, the test case would also
provide data/steps to enable/activate certain disabled elements. The GUI
verification test plan/cases would be prepared separately.
E.g. the following test case depicts how, while traversing the application,
checkpoints can be placed in the test case for performing GUI verification.
3. TESTING PROCESS
When WinRunner runs tests, it simulates a human user by moving the mouse
cursor over the application, clicking GUI objects and entering keyboard input.
Like a human user, WinRunner must learn the GUI of an application in order to
work with it. WinRunner does this by learning the GUI objects of an application
and their properties and storing these object descriptions in the GUI map.
When WinRunner learns the description of a GUI object, it looks at the object’s
physical properties. Each GUI object has many properties, such as “class,”
“label,” “width,” “height”, “handle,” and “enabled”. WinRunner, however, learns
only a selected set of these properties in order to uniquely distinguish the object
from all other objects in the application.
nd
July 02 , 2007 Page 14 of 19
Automated Regression Testing Framework
WinRunner uses a logical name to identify each object: for example “Print” for a
Print dialog box, or “OK” for an OK button. The logical name is actually a
nickname for the object’s physical description. The physical description contains
a list of the object’s physical properties: the Print dialog box, for example, is
identified as a window with the label “Print”. The logical name and the physical
description together ensure that each GUI object has its own unique
identification.
The user/tester would first need to create a GUI map by using the GUI Map Editor
to learn the properties of an individual GUI object, window, or all GUI objects in a
window. If the GUI of the application changes during the software development
process, the tester can use the GUI Map Editor again to learn individual windows
and objects in order to update the GUI map.
For creating the GUI Map File, the tester would need to teach WinRunner the
information it needs about the properties of GUI objects by clicking the Learn
button in the GUI Map Editor to learn the properties of an individual GUI object,
window, or all GUI objects in a window. The tester should however use User-
Friendly logical names while creating the GUI map file so that it is easier to
correlate to the actual fields/windows while developing the test plans.
To improve performance, the tester should use smaller GUI map files for testing
your application instead of one larger file. The tester should divide the
application’s user interface into different GUI map files by window or in another
logical manner e.g. module wise GUI Map file.
After preparing the GUI maps for the screens for which testing needs to be
performed, the corresponding Test plans need to be prepared. The Test plans
need to be prepared using the web interface defied in earlier sections.
• The name of Test Case, which needs to be executed for the Test
scenario.
nd
July 02 , 2007 Page 15 of 19
Automated Regression Testing Framework
• The name of internal column/GUI map file. The name of both files
should be (Internal map/GUI map) same for each module.
nd
July 02 , 2007 Page 16 of 19
Automated Regression Testing Framework
4. Other Details
Advantages
Disadvantages
1. Initial development of the function and utilities are costly and time-
consuming activity, which any developer can do after analyzing the
application. This is applicable to most of the GUI based regression-
testing tool.
2. Tester needs to learn “Key Words”, when & where to use it. The
framework generates how to use these key words in a systematic
way. Initially it could be time-consuming, and may have some impact
on development of this Test Plan.
nd
July 02 , 2007 Page 17 of 19
Automated Regression Testing Framework
5. Summary
¾ Identify clear goals and reasonable expectations as to what can and what
cannot be accomplished with automated testing.
♦ Identify test cases that can be automated which may include both
simple and complex scenarios so that maximum coverage is attained
with minimum number of test cases.
♦ Test Plan driven method is the one of the cost-effective approach with:
• A minimum number of automated scripts
nd
July 02 , 2007 Page 18 of 19
Automated Regression Testing Framework
nd
July 02 , 2007 Page 19 of 19