QTP Synchronization and Check Points

Synchronization
Objectives
1.Define Synchronization.
2.How to synchronize the Test
3.Some Visual Cue Examples
4.Examine when and where synchronization is most helpful.
5.Add a synchronization step for a specified object.
What is Synchronization ?

-Synchronization is a step added to a test that instructs QuickTest to wait for the state of a property on a particular object to change before proceeding to the next step in the test.
-This is done while in RECORD mode.
-The user/test waits for a visual indication that a step has completed so that the user/test can take the next step.
How to synchronize the Test
-We can synchronize the test by
1.Inserting a synchronization point
Insert -> Step -> Synchronization point
Window(“Flights”).WinButton(“Update order”).WaitProperty”enabled”,1,1000
2.Adding Exist and Wait statements
status=Window(“Flights”).Dialog(“Flights Table”).Exist
Wait(10)
Some Visual Cue Examples
-Synchronization point enables the anticipated time problems between the application and QTP.
-A progress bar reaches 100% completion.
-A status message appears.
-A button becomes enabled.
-A window opens and is ready for data entry.
-A pop-up message appears in response to an operation.
Examine the Application

Quick Test defaults to allocating the same amount of time for every object.
-Wait times often occur before an object becomes available for the next step. For example, in the Flights application, once the Insert Order button has been clicked, a process bar must complete to yield the Order No. associated with the reservation. The process bar may require additional time before the test can proceed. If insufficient time is allocated for these special circumstances, the test may fail.
The error message “Object not enabled” appears if QTP is running a test and proceeds to the next step before the previous step has fully processed.
Add a Synchronization Step While Recording

-Synchronization points which instruct QuickTest to pause until an object property achieves a specific value. The easiest method is to add a synchronization point while recording.
-A Synchronization step can be added manually after a test is recorded , as well.
-Always add the synchronization point immediately after the step to be synchronized.
-From the QTP menu bar, choose INSERT-> STEP-> SYNCHRONIZATION POINT
Checkpoints
-A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property.
-We can Insert checkpoint
1.From Menu
Insert -> Checkpoint -> Standard Checkpoint
2.From Keyword view
3.From the Active Screen
Checkpoint Types
1.Standard Checkpoint
2.Image Checkpoint
3.Table Checkpoint
4.Page Checkpoint
5.Text Checkpoint
6.Text Area Checkpoint
7.Bitmap Checkpoint
8.Database Checkpoint
Insert A Checkpoint From The Active Screen

-A checkpoint can be added after a test is created.
-Use the Active Screen to select the field on which the checkpoint will be added.
-Right-click on the appropriate field and choose “Insert Standard Checkpoint”.
Regular Expressions
-Regular expressions enable Quick Test to Identify Objects and text strings with varying values.
Use a Regular Expression


-A regular expression is a string that specifies a complex search phrase. By using
-special characters you define the conditions of the search.
-Note: There are 4 steps to ensure that a regular expression is inserted correctly.
-From the Checkpoint Properties window, ensure Constant is enabled and click on the note paper icon.
-Check Regular Expression checkbox.
-If QTP sees there are characters that can be misconstrued as a regular expression, it will ask you to treat it as a literal character. Generally, you will answer No.
-Add the regular expression. For example, above figure will use [A-Z a-z]+.

1 comment:

QPT said...

Very good information.
http://qualitypointtech.net/ebook/index.php

Post a Comment