An overview of Life Cycle of QTP
A typical Life Cycle of QTP undergoes the following stages:
1) Test Planning
2) Generating the Basic Test
3) Enhancing the Test
4) Debugging the Test
5) Executing the Test
6) Analyzing the Results.
Step 1: Test Planning: is an activity usually performed by the Automation Test Lead. In this phase following activities are performed
a) Understanding all the requirements.
b) Identification of the areas, which need to automated.
c) Analysis of Positive as well as Negative flow of areas being automated.
d) Based on the above analysis, next step shall be the preparation of the automation test plan document.
e) Then comes the preparation of the automation tool for its readiness with all the pre configuration
settings for further operations.
Step 2: Generating the Basic Test: In this phase the automation test engineer will generate the basis test for both the positive and negative flow of the test.
Step 3: Enhancing the Test: The following can enhance the test
a) Inserting the checkpoints.
b) Synchronizing the test.
c) Data-driven Testing.
d) Inserting the output values.
e) Measuring transactions.
f) Inserting program statements.
g) Inserting comments.
h) Inserting the script statement manually.
a) Enhancing the Test – By Inserting the Checkpoints: Checkpoint is defined as validation point or test point which checks the object or bitmap state or data state during the execution at any point of time.
Going by the operational over view of checkpoint; it works in two phases like :
1) Pre execution phase:
# It captures the expected value
# It generates the corresponding test script statement.
2) While execution phase:
# It captures the actual value.
# It compares the expected value with the actual value.
# It displays the results.
Following are the various types of Checkpoints:
1) Standard checkpoint
2) Bit map checkpoint
3) Text checkpoint
4) Text area checkpoint
5) Data base checkpoint
6) XML checkpoint
7) Page checkpoint
8) Table checkpoint
9) Image checkpoint
10) Accessibility checkpoint
1) Standard checkpoint: These are used for checking the properties values on standard GUI values. These can be inserted in two ways like 1) Through application 2) Through active screen
2) Bitmap checkpoint: These are used for checking the complete bitmap or a part of a Bitmap. These can be inserted in two ways like 1) Through application 2) Through active screen
3) Text Checkpoint: These are used for checking the Text present on a object. These can be inserted in two ways like 1) Through application 2) Through active screen
4) Text Area Checkpoint: These are used for checking the test present in a specified area. These can be inserted only through application but insertion through active screen is not possible.
5) Data Base Check Point: These are used for checking the contents of a database.
6) XML (Extended Markup Language) Checkpoint: These are used for checking the contents of an XML file. XML is a widely acceptable language universally used for data transformations.
Remaining Four Checkpoints are Web Based Checkpoints
7) Page Checkpoint: These are used for checking the properties of a web page like Load time, Number of Links and number of Images etc.
8) Table Checkpoint: These are used for checking the contents of a web table.
9) Image Checkpoint: These are used for checking the images on a web page.
10) Accessibility Checkpoint: These are used for checking whether the page can be accessible by more number of persons or not. In this process it basically checks as to whether the web page has been developed according to the WWW (world wide web consorted) standards or not.
b) Enhancing the Test – By Synchronizing of Test: Synchronization: is a process of matching the speed of both the tool and the application in order to keep them in synchronization with each other to obtain proper testing results. Basic hypothesis is making the automation tool to wait. This can be achieved in three ways like.
# By inserting the synchronizing point.
# By increasing the default time.
# By inserting the wait statement.
c) Enhancing the Test – By Data Driven Testing: It is a concept introduced in automation to implement Re-Testing. It involves following four steps.
# Collection of the data in to the Data Table
# Generation of the Basic Test.
# Execution of the Test.
# Analysis of the Results.
Parameterization: Is a process of replacing the constant values with the variables or parameters in order to increase the scope of the test. Parameterization can be driven through 1) Data Driven Wizard 2) Keyword View 3) Manually.
This way all the constant values can be parameterized and we can ultimately click “OK”.
Direct manual parameterization can also be done to avoid the lengthy process of navigation. For example:
A = data table (“V1”,1)
Vbwindow (“form1”). Vbedit (“val1”). Set a.
Vbwindow (“form1”). Vbedit (“val2”). Set data table (“V2”, 1)
Vbwindow (“form1”). Vbbutton (“Add”). Click
d) Enhancing the Test – By Inserting the Output Values: Is a feature provided by QTP & is used, for capturing a value from an application or from a database or from a XML file and storing it under a specified column in the run time data table during the execution. Following five types of output values are provided in QTP.
# Standard output value.
# Text output value.
# Text area output value.
# Database output value.
# XML output value.
The Output values feature operates in two phases like: 1) Pre-Execution phase 2) While � Execution phase.
1) Pre-Execution phase: Captures the field name from where the value is to be captured and generates the corresponding script statement.
2) While execution phase: Captures the actual value form the field and stores it under a specified column in the run time data table.
e) Enhancing the Test – By Measuring Transactions: Is a concept used for calculating the time taken by an application to perform a specific task or the execution time of a block of script statements. We have two options in QTP like : 1) Start Transactions 2) End Transactions.
f) Enhancing the Test – By Inserting Program Statements: Vb script is a combination of five types of program statements like the following.
# Normal statements / Objects.
# Conditional statements.
# Utilities Statements.
Step 4: Debugging the Test: Debugging is a process of executing the script or a program in a user desired fashion with sole aim to identify the errors. QTP uses three types of Step Commands and a Break Point feature as described below.
Step Command – 1: Step Into: Is used for executing a single step in case of a normal statement. However if the concerned statement is a function or action call statement then it will step into that function or action and will break it�s execution.
Step Command – 2: Step Out: Is used for stepping out of a function or action by executing all the remaining statements from the position of the pointer.
Step Command – 3: Step Over: Is used for executing a single step in case of a normal statement. However if the concerned statement is a function call or action call it will execute all the statement inside the function or action once and stops it�s execution at the next statement.
Break point: Is used for temporarily breaking the execution. For Example
Msgbox “How Are You”
Msgbox “Bye Bye”
Msgbox “See You Soon”
Debug Viewer Pane: Is an area used for viewing, modifying or setting the current values of the variables or expressions during the execution break with the help of three tabs like: 1) Watch expression 2) Variables 3) Commands. For example:
Step 5: Executing the Test: In this phase we shall carry out the execution of the Test.
Step 6: Analyzing the Results: In this phase we shall carry out detailed analysis of the Results.
An expert on R&D, Online Training and Publishing. He is M.Tech. (Honours) and is a part of the STG team since inception.