Professional Documents
Culture Documents
Automationframework 101229063140 Phpapp02
Automationframework 101229063140 Phpapp02
com
QTP
Frame Work
www.ramupalanki.com
Table of Contents
1.
1.1
1.2
2.
2.1
2.2
3.
3.1
3.2
4.
4.1
4.2
4.3
4.4
4.5
5.
5.1
5.2
5.3
5.4
5.5
5.6
Automation Architecture
Design
Approach for Test Automation
Introduction to QTP
Add-Ins
Types of Add-Ins
Conditions for Add-ins
Conventions
Settings
www.ramupalanki.com
4
4
5
12
12
13
21
21
22
23
23
24
25
26
27
28
28
29
30
31
33
36
39
39
7.
Data Table
41
7.1 Datatable Object and related Functions:
41
7.2 Organizing Data Sheets for Global & Local variables
42
7.3 Parameterizing using Data driven Wizard
44
7.4 Importing and Exporting Datasheets:
48
8.
Actions
52
8.1 Actions Settings
52
8.2 Iterations using rows
53
8.3 Action Template
53
8.4 Script Startup
54
8.5 Splitting Actions, Re-usable Actions, Internal/External Actions 56
9.
Object Repository
57
9.1 Per Action/Shared Object Repository:
57
9.2 Merging of two object repositories:
59
9.3 Limitations:
61
10. Variables
62
10.1 Action Parameters
62
10.2 Test Parameters
65
10.3 Environment Variables
67
10.4 Variable passing from one Action to another
68
10.5 Scope of Variables
70
11. Check Points
72
11.1 Types of Checkpoints
72
11.2 Output Values for Verification
74
12.
Reusable Library
77
12.1 Introduction
78
12.2 How to establish a Reusable Library
78
12.3 How to use this Reusable Library.
80
13.
Regular Expressions
81
13.1 Description
81
14.
Recovery Scenario
87
14.1
Exceptional Handling using Recovery Scenarios
88
14.2
Sample for Recovery Scenario:
94
15.
Optional Steps
100
15.1
Description:
100
16.
Reporting
102
16.1
Different Options for Reporting
103
16.2
Functions used for Reporting
104
16.3
Reporting Formats
107
6.1
Objects
Objects
www.ramupalanki.com
1. Automation Architecture
1.1 Design
www.ramupalanki.com
Description
Approach for Test Automation is used for building a strategy for automation starting from
the Requirement phase till the deployment phase. Approach for automation begins with
finding out the conditions and business rules given by the client and grouping similar
conditions, business rules together as Test cases or Test Scenarios.
Steps involved in Approach for Test Automation are as follows:
www.ramupalanki.com
Automation Framework:
For Quality deliverables, important things that should be followed are:
Main Action
in the Script
<Action Name>
Calls
www.ramupalanki.com
Called Actions
<Action Name>
www.ramupalanki.com
Application Login,
Logout, Common
Functionality
Related code etc
General library
containing String
handling, Date handling,
File Handling, Data Table
handling
www.ramupalanki.com
Coding Standards & Naming Conventions like The file name as per
convention - Scenario name, The Action named as per transaction ID
Application
Login, Logout
and common
functions like
LT12, MM03
Recoveries are
gAlready_exist.qrs
S014_164_Materia
l_Not_Maintained.
qrs
Test Data
Handling and
Data Sheet
Importing
SAP
Application
Session
Login
Script for
Business
Transaction/T
est Case
Test Results
Reporting
and
Application
Closing.
Re-Usable Library:
Generic Library calls for handling data, date, string etc
Error handling Library
Recovery Scenario
Actions
Tests that need to run once and those that need frequent human
intervention are usually not worth the investment to automate and have not
been considered for automation.
Mission critical processes like core activities like sales order processing
are prime candidates for automated testing and have been considered for
automation.
www.ramupalanki.com
Repetitive Testing
www.ramupalanki.com
2.
Introduction to QTP
Windows XP/2000/NT
Windows 95/98/ME
Databases Supported:
Networks Supported:
Programming
Languages Supported:
(Not Applicable)
TCP/IP
JavaScript
Java
HTML
Visual Basic (VB)
XML
Middleware Supported: Microsoft .NET
www.ramupalanki.com
Browser:
Supported Environments
QuickTest Professional supports creating, recording, and running tests in the
environments described below.
Standard Windows Applications
1. Win32 API
2. MFC
Visual Basic Applications
Visual Basic 6.0
Browsers
www.ramupalanki.com
ProgId
FPSpread.Spread.1
FPSpread.Spread.2
FPSpread.Spread.3
FPSpread.Spread.4
FPSpreadADO.fpSpread.4
MSGrid.Grid
MSDBGrid.DBGrid
MSFlexGridLib.MSFlexGrid.1
SSDataWidgets.SSDBGridCtrlApt.1
SSDataWidgets.SSDBGridCtrlApt.3
TrueDBGrid50.TDBGrid
TrueDBGrid60.TDBGrid
TrueOleDBGrid60.TDBGrid
ProgId
www.ramupalanki.com
MSComCtl2.MonthView.2
Multimedia Applications
QTP6.5 supports testing on the following multimedia applications:
Microsoft Windows MediaPlayer controls, version 6.0 and higher
RealPlayer controls supported for Internet Explorer browsers (the controls
within applications containing browser controls are not supported)
Macromedia Flash 4 or 5 objects that are ActiveX controls in Internet
Explorer. You can also test Macromedia Flash 6 clips containing only
Flash 4 or 5 commands.
Additional Environments
QuickTest Professional add-ins support other environments such as
Java, .NET Windows and Web Forms, SAP solutions, Oracle, Siebel,
PeopleSoft, Web Services, and terminal emulator applications. For more
information about QuickTest Professional add-ins, contact your sales
representative or Mercury Interactive Customer Support.
Note for QuickTest Professional 6.0 and earlier:
Java support and Oracle support are now available as separate add-ins to
QuickTest Professional 6.5 and are no longer part of the core product.
QTP 8.0:
www.ramupalanki.com
Operating System:
Memory:
Browser:
Supported Add-ins
The following external QuickTest 6.5.x add-ins are supported for use
with QuickTest Professional 8.0:
www.ramupalanki.com
www.ramupalanki.com
ProgId
FPSpread.Spread.1
FPSpread.Spread.2
FPSpread.Spread.3
FPSpread.Spread.4
FPSpreadADO.fpSpread.4
MSGrid.Grid
MSDBGrid.DBGrid
MSFlexGridLib.MSFlexGrid.1
SSDataWidgets.SSDBGridCtrlApt.1
SSDataWidgets.SSDBGridCtrlApt.3
TrueDBGrid50.TDBGrid
TrueDBGrid60.TDBGrid
TrueOleDBGrid60.TDBGrid
ProgId
www.ramupalanki.com
MSComCtl2.MonthView.2
Microsoft Query
When using Microsoft Query with QuickTest Professional 8.0 (for
example, for Database checkpoints), you can work with Microsoft
Query 2000, 2002, 2003, and XP.
Additional Environments
QuickTest Professional add-ins support other environments such as
Java, .NET Windows and Web Forms, SAP Solutions, Oracle, Siebel,
PeopleSoft, Web Services, and terminal emulator applications. For more
information on QuickTest Professional add-ins, contact your sales
representative or Mercury Interactive Customer Support.
www.ramupalanki.com
3. Add-Ins
3.1 Types of Add-Ins
QTP version
8.2
Add-ins
Java add-in 6.5
Oracle add-in 6.5
Siebel add-in 8.0
Terminal Emulator add-in 8.0
. Net add-in 8.2
Default Add-Ins: Active X Controls,
Web &Visual Basic
8.0
6.5
. Net
Web
Java
XML
Default Add-Ins: Active X controls,
Multimedia, Visual Basic, Web
Note: Quick Test Professional Siebel add-in 6.5 and Web services add-in 6.0 cannot be
used with Quick Test 8.0.
The add-ins for Quick Test Professional 6.0 cannot be used with Quick Test
Professional 6.5. If you are using Quick Test Professional 6.5, you will need to get
the 6.5 version of your add-in.
www.ramupalanki.com
Java Add-In
When testing Java applets in a Web browser, you must load the Web add-in as well as the
Java Add-in, and use the Web tab of the Record and Run Settings
Dialog box to specify your record and run preferences. To test Java applets or
applications running on Netscape 4.xs built-in JVM (not Java Plug-ins), confirm that the
Netscape 4.x browser is already installed before installing the Quick Test Professional
Java Add-in. When testing Java applets in a Web browser web Add-in as well as java addin must be loaded .To create a checkpoint, parameterize a step, or to add a method from
individual java applets, the Java Add-in must be loaded.
3.2.2
.Net Add-In
The .Net add-in is required to support objects developed in .Net .In some cases, even
though the application has been developed using .Net, when the page is sent to the
browser, it is a plain HTML page. Quick Test Professional can recognize HTML controls
like edit fields, buttons etc. without the .Net add-in. However, if a Web application
contains complex controls like ActiveX or other controls developed in .Net like ASP.Net
server controls, it is required to use the .Net add-in to achieve object recognition.
3.2.3
Sap Add-In
The Sap add-in is required for all SAP applications. In SAP application Grid Tables,
Status Bar messages, Labels can be identified only if SAP Add-in is installed.
www.ramupalanki.com
4. Conventions
The Conventions for Naming for test cases, Scripts and Actions vary from Project to
Project depending upon the Client.
Test Case
For example:
Example 1: Considering that Each Use case is associated with one Test case. If the name
of the Use Case were UC_001 then the Test case name would be TC_001.
Example 2: In the Unilever Automation Project, SAP transactions are divided into
different modules, in those modules different transactions are grouped together as a
scenario, so for writing the test case for a particular scenario naming convention used is
module name followed by scenario name.
For Module IMWM, if S014_01 is the scenario name, so name of the test case
for the S014_01 scenario was given as IMWM_S014_01.
Test Case
Test script
Condition 1
Action1
Condition2
Action2
Therefore for a Test Script corresponding to a Test Case named TC_001 would be
QTS_001.The hierarchy should be maintained in case the use cases or test cases are
nested.
E.g.: TC_01_014 would have a QTP Test Script as QTS_01_014.
Action Naming:
Each Test Script can contain one or more Actions, with one or more actions representing
a test Condition.
Actions can be named in 2 ways:
1. Functionality of the Action
2. Hierarchy of the Action in the Test Script.
1. Functionality of the Action:
Typically Actions are segregated by their functionality in the Test Script.
Therefore it would be easier to understand the Action if the name of the action
represents the Functionality.
For E.g.: An Action written or recorded for logging the user should be named as
Login or Authentication for easy understandability.
An Action for booking tickets should be named as Book_Tickets
An Action for exiting the application named as Exit.
This also adds a huge advantage when the Actions are made
reusable. Reusable Actions can be used between various scripts. When an Action
is to be made reusable the action should be named as REUSE_(Action name).
Example: REUSE_Login.
www.ramupalanki.com
Data Types
Example
bChecked = True
Date/time
All numeric data types
(Byte, Integer, Currency, Long, Single, Double)
Objects
Strings
User interface elements
dStartTime = Now
i
o
s
u
Constants Prefix:
Usually there are only a handful of constants in any scripts. Indicating the data type
therefore is less important for constants. Prefix letter c for all constants can be used.
e.g. Const cTitle = "Welcome!"
UDocument.title = cTitle
www.ramupalanki.com
2) Action Parameters
a) Action Input Parameters: These are local to Action of a Test. These can be named as
ACTIN_(variable name). ACTIN denoting that its an Action Input Parameter.
Example: ACTIN_iResult
b) Action Output Parameters: These could be named as ACTOUT_(var name).
www.ramupalanki.com
3) Environment Variables:
Environment variables are either built-in or User defined. Built-in variables cannot be
declared named by the user, so their naming convention is not discussed.
User Defined Environment Variables are either Internal or External.
Internal Variables: ENV_INT_(variable name)
External Variables: ENV_EXT_(Variable name)
www.ramupalanki.com
5. Settings
5.1 QTP Test Settings
Before Running or Recording any test on QTP, the QTP Test settings need to be set as per
the requirements of the Test. Setting these Test Settings before starting a Test plays a
crucial part in the behavior of the test.
These can be found at the path Test>Settings. A dialog box pops up, in which various
tabs are present which allow one to set
Properties of the test like Add-Ins used
Run time Preferences
Resources like files, data tables, and repository to be used.
Parameters required in the Test.
Environment variables used
Web navigation
Recovery Scenarios
Note: For further details about the use of each tab, refer to QTP Test Settings
www.ramupalanki.com
For further details about these settings refer to Record and Run Settings.
For details about each capture level, refer to ActiveScreen Capture Level.
www.ramupalanki.com
In the Per-Action mode, objects are identified and separated on the basis of each
action and the corresponding object repository for the test is created in the test
folder.In the Shared mode, the user may choose a location to save the shared
object repository files for all the tests.
All the Objects recorded during a test,and their properties can be seen and
manipulated in the Tools>Object Repository.There are provisions in this Object
Repository Dialog box to add new objects,spy objects, find and replace property
values etc.
www.ramupalanki.com
www.ramupalanki.com
Fig: Keyword view and Active Screen view corresponding to one expert view statement
5.5.1
Step Generator:
If the user is familiar with VBScript, the user can add and update statements and enhance
the tests and components with programming. After the test or an Action is recorded, its
power and flexibility can be increased by adding recordable and non-recordable VBScript
statements as required for tasks like Check Points,Datatables etc.,.These additional steps
can be added either manually or using Insert>Step >Step Generator .whenever a step is
added to a script, then any Syntax errors of the step can be Identified in its Keyword
view.
www.ramupalanki.com
The Step Generator enables you to add steps quickly and easily, by selecting from a range
of context-sensitive options and entering the required values.The generated step gets
added at the position of cursor in the expert view.
The Step Generator enables you to add steps quickly and easily, by selecting from a range
of context-sensitive options and entering the required values. In the Step Generator dialog
box you can define steps that use:
test object methods and properties
utility object methods and properties
calls to library functions, VBScript functions, and internal script functions
www.ramupalanki.com
www.ramupalanki.com
6. Objects
6.1 Objects
Objects are the things which contains different properties and methods.
For Example: Window is said to be an object which consists of properties such as
Exist, GetROProperty and methods such as ChildObjects, Activate, maximize,
minimize etc.
Property:
Property describes about the object defined, each object has different properties,
which is necessary to describe the object, which differentiates the given object
with other objects.
For example: If we take a window object, we first have to define to which class it
belongs to which is one of the property, it belongs to a window class. Exist is a
property which is common to many objects which returns true if that object exists.
Methods:
Methods are functions, which are used for changing the properties of the object
that is in order to manipulate with the object properties we use.
For example: If we take a window object, Activate is a method used to activate
the window object, thus by using Activate method Activate property of the present
window object is set to true, thus the window object will be activated if not in
activated mode.
www.ramupalanki.com
Child Object
for Dialog
Object
In the above sample of code, there are two main Objects, one is Dialog and
the other is Window object. This objects contain child objects, For Dialog
object which is named as Login has WinEdit object with name as Agent
Name: as childobject, here Set is the method used to set a text into the
WinEdit object.
Dialog
Parent Object
named as Login
Child Object
named as Agent
WinEdit
Name:
Set is the method associated with WinEdit object
www.ramupalanki.com
7. Data Table
In QTP scripting there are many objects that are used, One of the Objects used in
QTP scripting is DataTable Object.
Importsheet : This function is used to Import sheet into the script, so that all
the data in the imported sheet can be used in the script.
Syntax:
Datatable.Importsheet(nameofExcelfilewithpath,
nameofthesourcesheet, nameofthedestinationsheet)
Exportsheet : This function is used to Export sheet from the script, all the
data including output values are stored in the default sheet for the action, this
sheet is exported and stored in a specified location using this function.
Syntax:
Datatable.Exportsheet(nameofExcelfilewithpath,
Nameofthesheet)
www.ramupalanki.com
www.ramupalanki.com
Action name:
Login
Global
Sheet
For example consider script for entering Login name which is as follows
Dialog("Login").WinEdit("Agent Name:").Set "name"
The Set property of WinEdit Object appears in the list of Datadriver with name as
Value representing the Set property of Agent Name Editbox, which is as given below:
www.ramupalanki.com
Step-by-step Parameterization: Enables you to view the current values of each step
containing the selected value. For each step, you can choose whether or not to
parameterize the value, and if so, which parameterization options you want to use, the
Next button is enabled when you select this option, this will enable us to select an other
instance of the constant selected and parameterize that instant, it will continue the same
process till all the instances of the given value are done.
www.ramupalanki.com
Parameterize all: Enables you to parameterize all occurrences of the selected value
throughout the action.
When you select this option the Parameter details area is enabled. The Finish button is
enabled when you select this option.
www.ramupalanki.com
Here Parameter tab can be selected using the button given at the Parameter radio
button, and in the next screen select the datatable Field from where the property for
which the value belongs is parametererized, click on Finish button thus all the instances
of the value selected for parameterization will be parameterized.
Note: All the fields in the imported sheets should match with the data used in the script.
www.ramupalanki.com
www.ramupalanki.com
8. Actions
www.ramupalanki.com
www.ramupalanki.com
Option
Description
Runs the called action only once, using the row in the action's data
sheet that corresponds to the current global iteration number. If the
action's data sheet contains fewer rows than the global sheet, the
last row of the action's data sheet is used for each subsequent test
iteration.
Run one
iteration
only
For example, suppose an action's data sheet has two rows and the
global sheet has four rows. If you choose to run one iteration only
for the action and you choose to run iterations on all rows of the
global data sheet, then during each iteration of the test, this action
will run only one iteration. The data that the action parameters use
during each repetition of the test are based on the iteration number
for the test.
During the first iteration of the test, Data Table parameters in the
action take data from the first row of the action's data sheet. In the
second iteration of the test, Data Table parameters in the action take
data from the second row of the action's data sheet. In the third and
subsequent iterations of the test, the Data Table parameters in the
action continue to take data from the second i.e. the last row of the
action's data sheet.
Run on all
rows
Run from
row __ to
row __
The Run tab of the Action Call Properties dialog box applies to individual action calls
and refers to the rows in the action's data sheet.
www.ramupalanki.com
ActionTemplate.ms t
Example:
The Resources tab of the Test Settings dialog box can be used to associate specific files
with the test, such as Data Table files.
The option area Other location instructs Quick Test to use data stored in the specified
Data Table location. The Data Table can be any Microsoft Excel (.xls) file.
www.ramupalanki.com
Check for the Data table iterations under the test settings for which the test has
to be run.
For further details refer to QTP test settings doc.
A test is made up of calls to actions. When you create a new test, it contains a call to a
single action or create tests that call multiple actions by inserting calls to them, to make
the design more modular and efficient tests.
www.ramupalanki.com
9. Object Repository
9.1 Per Action/Shared Object Repository:
www.ramupalanki.com
Select "Per-action" to set the Object Repository mode for your test to the Object
Repository per action mode.
Below are some of the factors based on which Per Action option is selected
www.ramupalanki.com
Select "Shared" to set the Object Repository mode for your test to the Shared
Object Repository mode.
Below are some of the factors based on which Shared Action option is selected
5. If you selected Shared in step 4, specify the Shared Object Repository file you want to
use as the test's Object Repository file. To specify a file, enter the Object Repository file
name or click the "Browse" button and select a resource file (*.tsr) from the Open dialog
box. To create a new Shared Object Repository file, enter a new file name in the Shared
box.
Note: These steps need to be done in a new script. Once you have modified the script,
you will not be able to change the option.
To set all new scripts to use a Shared Object Repository:
For Quick Test Professional 6.5 and above
1. Click the New button or go to File -> New to open a new test.
2. Go to Test -> Settings.
3. Select the Resources tab.
4. Select the Shared option for the "Object-repository type".
5. Specify the Shared Object Repository file you want to use as the test's Object
Repository file. To specify a file, enter the Object Repository file name or click the
ellipse button <...> and select a resource file (*.tsr) from the Open dialog box. To create a
new Shared Object Repository file, enter a new file name and path in the Shared box.
6. Click the "Set as Default" button.
7. Click <Apply> and <OK>.
www.ramupalanki.com
9.3 Limitations:
1. Mercury Interactive recommends that you keep the Object Repository under 1 MB and
perform regular backups. If the size crosses more than 1MB loading of object repository
takes lot of time .
2. The limitation on the number of Actions is 255. The reason is that each Action has a
data table sheet. The Formula 1 control has a limitation of 255 sheets so the limitation is
255 Actions per test. You may be able to add additional Actions after reaching the 255
"limit", however those Actions will not be able to access a local data sheet.
www.ramupalanki.com
10. Variables
In QTP scripting there are mainly 3 types of variable that we use. They are:
www.ramupalanki.com
Action Parameters.
Environment Variables.
VB Variables, which we declare in the script.
www.ramupalanki.com
www.ramupalanki.com
You can edit an existing parameter by selecting it in the appropriate list and
modifying its details.
You can add and delete input and output parameters for your test or component
using the parameter control buttons:
www.ramupalanki.com
Description
Adds a parameter to the appropriate parameter list. Enter a name for the
new parameter and select the parameter type. You can enter a description
for the parameter, for example, the purpose of the parameter in the
component. If you are defining an input parameter, enter a default value
for the parameter in the Default Value column.
You define test or component parameters in the same way you define
action parameters.
Removes the selected parameter from the test or component.
www.ramupalanki.com
www.ramupalanki.com
You can specify a location in which to store the output action parameter values, which
can be used in the called action.
www.ramupalanki.com
If we choose variable to store the value, then the value is stored in a runtime variable for the duration of the run session. You can accept the
default name assigned to the variable or enter a different variable name.
Alternatively, you can click the output storage button
in the Store In
box to open the Storage Location Options dialog box in which you can
specify a location for storing the output value. You can select to store the
value in a test or action parameter, a Data Table parameter, or an
environment parameter.
2. Repeat this procedure for each output action parameter value in the list.
www.ramupalanki.com
Image Checkpoint checks the value of an image in the application or Web page.
For example, we can check that a selected image's source file is correct.
Note: Image checkpoint can be created by inserting a standard checkpoint on an
image object.
Image checkpoints are supported only for the Web environment
www.ramupalanki.com
Text Area Checkpoint checks that a text string is displayed within a defined
area in a Windows application, according to specified criteria. For example,
suppose your Visual Basic application has a button that says View Doc <Num>,
where <Num> is replaced by the four digit code entered in a form elsewhere in
the application. You can create a text area checkpoint to confirm that the number
displayed on the button is the same as the number entered in the form.
Text area checkpoints are supported for Standard Windows, Visual Basic, and
ActiveX add-in environments Text area checkpoints are also supported for some
external add-in environments.
Accessibility Checkpoint identifies areas of your Web site that may not
conform to the World Wide Web Consortium (W3C) Web Content Accessibility
Guidelines. For example, guideline 1.1 of the W3C Web Content Accessibility
Guidelines requires you to provide a text equivalent for every non-text element.
You can add an Alt property check to check whether objects that require the Alt
property under this guideline, do in fact have this tag.
Accessibility checkpoints are supported for the Web environment
Page Checkpoint checks the characteristics of a Web page. For example, you can
check how long a Web page takes to load or whether a Web page contains broken
links.
Note: You create a page checkpoint by inserting a standard checkpoint on a page
object.
Page checkpoints are supported for the Web environment
www.ramupalanki.com
XML Checkpoint checks the data content of XML documents in XML files
or XML documents in Web pages and frames. XML checkpoints (Web
page/frame) are supported for the Web environment; XML checkpoints (file) are
supported by all environments
For more specific information refer to Checkpoints
Global\Local Sheet
Environment variables
www.ramupalanki.com
www.ramupalanki.com
12.1 Introduction
In QTP we can create VBScript library files containing VBScript functions, subroutines,
classes, modules, etc., and then associate the files with our test. We can call any VBScript
function, subroutine, etc., contained within any library file that is associated with our test.
Any text file written in standard VBScript syntax can act as a library file.
a) Functions
i. Built-In
ii.
User defined
We can specify the default library files for all new tests in the Test Settings
dialog box (Test > Settings > Resources tab). We can also edit the list of
associated library files for an existing test in the Test Settings dialog box.
Note that once a test is created, the list of files specified in the Test
Settings dialog box is independent of the files set as default in the Test
Settings dialog box. Changes to the default library files list in the Test.
www.ramupalanki.com
When we run our test, the ExecuteFile statement executes all global code in the specified
file in order to make all definitions in the file available from the global scope of the
action's (or library file's) script.
To execute an externally-defined function:
www.ramupalanki.com
www.ramupalanki.com
For example:
\w* causes QuickTest to match zero or more occurrences of the alphanumeric
charactersA-Z, a-z, 0-9, and the underscore (_). It matches Ab, r9Cj, or
12_uYLgeu_435.
For example:
\w{3} causes Quick Test to match 3 occurrences of the alphanumeric characters AZ, a-z, 0-9, and the underscore (_). It matches Ab4, r9_, or z_M.
14. Matching Any Non-AlphaNumeric Character
\W instructs QuickTest to match any character other than alphanumeric characters
and underscores. For example:
\W matches &, *, ^, %, $, and # .
15. Combining Regular Expression Operators
You can combine regular expression operators in a single expression to achieve
the exact search criteria you need.
For example, you can combine the `.' and `*' characters in order to find zero or
more occurrences of any character (except \n).
For example, start.*
matches start, started, starting, starter, etc.
You can use a combination of brackets and an asterisk to limit the search to a
combination of non-numeric characters. For example:
[a-zA-Z]*
The checkpoint passed because the text was displayed in the format specified by
the regular expression.
www.ramupalanki.com
www.ramupalanki.com
The Recovery Scenario Manager contains the following recovery scenario icons:
Icon
Description
Indicates that the recovery scenario is triggered when a window pops up
in an open application during the test run.
Indicates that the recovery scenario is triggered when the property values
www.ramupalanki.com
The Recovery Scenario Properties dialog box displays the following read-only
information about the selected scenario:
www.ramupalanki.com
Note: If a scenario with the same name already exists in the recovery scenario file, you
can choose whether you want to replace it with the new scenario you have just copied.
Setting the Recovery Scenarios List for Your Tests
After you have created recovery scenarios, you associate them with selected tests so that
Quick Test will perform the appropriate scenario(s) during the test runs if a trigger event
occurs. You can prioritize the scenarios and set the order in which Quick Test applies the
scenarios during the test run. You can also choose to disable specific scenarios, or all
scenarios, that are associated with a test. You can also define which recovery scenarios
will be used as the default scenarios for all new tests.
Adding Recovery Scenarios to Your Test
After you have created recovery scenarios, you can associate one or more scenarios with
a test in order to instruct Quick Test to perform the recovery scenario(s) during the test
run if a trigger event occurs. The Recovery tab of the Test Settings dialog box lists all the
recovery scenarios associated with the current test.
Tip: When a trigger event occurs, Quick Test checks for applicable recovery scenarios in
the order in which they are displayed in the Recovery tab. You can change this order as
described in Setting Recovery Scenario Priorities
For more information on adding a recovery scenario to a test refer to Adding Recovery
Scenario to a Test
Viewing Recovery Scenario Properties
You can view properties for any recovery scenario associated with your test.
To view recovery scenario properties:
1 In the Scenarios box, select the recovery scenario whose properties you want to view.
2 Click the Properties button
. Alternatively, you can double-click a scenario in the
Scenarios box. The Recovery Scenario Properties dialog box opens, displaying read-only
information regarding the settings for the selected scenario.
Setting Recovery Scenario Priorities
www.ramupalanki.com
In order to handle this, take a new recovery scenario, in the Select Trigger Event screen
of Recovery Scenario Wizard, select pop-up window Radio button as shown below,
www.ramupalanki.com
In the next screen, we can specify Pop-up window condition, by spying the popup
window, then details of the pop-up window appears as follows:
www.ramupalanki.com
www.ramupalanki.com
then in the next step, In the recovery operation screen select function call radio button
Specify the path and name of the library file which has the appropriate function for
entering the password and clicking ok button of Login dialog box.
In the Post-Recovery Test Run Options screen select Repeat current step and
Continue radio button, give a name to the recovery scenario, thus the recovery will be
created.
Adding a Recovery scenario into the Test:
We can add the Recovery Scenario to our test in two ways.
1. We can add the Recovery Scenario to our test while we create a new Recovery
Scenario by checking the add Scenario to current test check box in Completing
the Recovery Scenario Wizard screen of Recovery Scenario Wizard.
www.ramupalanki.com
2. The other way to add Recovery Scenario to our test is by adding the required
scenario file in the recovery tab of Test Settings Dialog box.
www.ramupalanki.com
www.ramupalanki.com
Description:
When running a test, if a step does not succeed in opening a dialog box,
QuickTest does not necessarily abort the test run. It bypasses any step
designated "optional" and continues running the test. By default,
QuickTest automatically marks as optional steps that open certain dialog
boxes. You can manually designate additional steps as optional.
If a dialog box may or may not appear at a particular instanse then that
dialog box actions performed can be set as optional, so that it proceeds to
the next step, if the screen or dialog box doesnt appear or will continue
the normal flow.
www.ramupalanki.com
www.ramupalanki.com
16. Reporting
The process of reporting is to customize the test results, and add the appropriate
comments and reports to the test results to increase the readability of it. Reporting can be
done in various formats.
Test Results Window
After a test run, we view the results in the Test Results window. By default, the
Test Results window opens when a test run is completed.
Note: You can open the Test Results window as a standalone application from the
Start menu. To open the Test Results window, choose Start > Programs >
QuickTest Professional > Test Results Viewer.
Note: If Always option is selected then the result file will occupy lots of memory, thus
selection of Always option should be done only if the client wants to view all the
screen shots for reference during review.
www.ramupalanki.com
1. ReportEvent Method
Reports an event to the Test Reports.
Syntax: Reporter.ReportEvent EventStatus, ReportStepName, Details [, in]
Argument
EventStatus
Type
Number or
pre-defined
constant
Description
Status of the report step:
0 or micPass: Causes the status of this step to be
passed and sends the specified message to the report.
1 or micFail: Causes the status of this step to be
failed and sends the specified message to the report.
When this step runs, the test fails.
2 or micDone: Sends a message to the report
without affecting the pass/fail status of the test.
3 or micWarning: Sends a warning message to the
report, but does not cause the test to stop running,
and does not affect the pass/fail status of the test.
4 or micInfo: Applies an information status (and
icon) to the step. This status does not affect the
pass/fail status of the test.
ReportStepName String
Details
String
in
N/A
Not in use.
Example
The following example uses the Report Event method to report that the checkpoint on
this window has passed.
Reporter.ReportEvent 0,"Fax Order No. 12","The check point for this window has
passed "
2. Filter Property
www.ramupalanki.com
Mode
Description
0 or
rfEnableAll
1 or
rfEnableErrorsAndWarnings
2 or
rfEnableErrorsOnly
3 or
rfDisableAll
Example
The following example uses the Filter method to report the following events in the Test
Results: 1, 2, 5, and 6.
Reporter.ReportEvent micGeneral, "1", ""
Reporter.ReportEvent micGeneral, "2", ""
Reporter.Filter = rfDisableAll
Reporter.ReportEvent micGeneral, "3", ""
Reporter.ReportEvent micGeneral, "4", ""
Reporter.Filter = rfEnableAll
Reporter.ReportEvent micGeneral, "5", ""
Reporter.ReportEvent micGeneral, "6", "
www.ramupalanki.com
Argument Type
Path
Description
String The folder path in which the current test's Test Results are stored.
Example
The following example uses the ReportPath method to retrieve the folder in which the
test's Test Results are stored and displays the folder in a message box.
dim Path
Path = Reporter.ReportPath
MsgBox (Path)
www.ramupalanki.com
www.ramupalanki.com