Waiting time in the sense that if you have an application in
which you have 3 steps for example.
Let's say you are recording the steps where the first step
is to enter the information, second step is clicking submit
button and third step is printing the summary page.
Now when you click submit button it may take few seconds to
several minutes depending on the application or internet
speed.After your summary page has loaded you click print.
But when you play this in Qtp it does it very fast,it does
not wait for processing of information after you click
submit button and may try to print summary page which will
So, to overcome such problems we insert synchronization
point.By inserting synchronization point we are asking QTP
to wait till Summary page is loaded and then click Print button.
synchronization point is nothing but time interface between
tool and application build.generally we r giving
synchronization point to give waiting time to the tool.
3 ways we can do this.i.e
1-synchronization point: here we r giving waiting time to the
tool depending on application status bar.suppose in yahoo
regiistration form after fillup when click on submit after
colour filling the status bar it will go to next page.if we
r not giving synchtonization point when tool execute the
next page script it show an error page not found.
navigation:insert menu-step-synchronizatiobn point
2-wait():here we r giving fixed waiting to the tool
3-increasing time out:bdefault QTP maintains 20000
milisecond to identify object.if it is taking more time to
identify all the objects then we hav to increase the time out.
navigation:tool-option-run tab increase our time there in ms.
Wait() is used when you want QTP to wait for specified time
whereas synchronization is used when you want QTP to wait
till certain process is completed or event has occured.
Wait(n) statement waits for specified 'n' seconds even
though process has occured in less than n seconds whereas
when using sync statement ,QTP resumes/moves to next step as
soon as event has without wasting time.
There is another similar option called exist(n) which waits
for an object (like button to be activated) or waits till
'n' seconds whichever is earlier.
‘The following example uses the Exist method to check
'Search Flights image exists five seconds after it clicks
Browser("Mercury Tours").Page("Mercury Tours").Image
("Login").Click 0, 0
If Browser("Mercury Tours").Page("Welcome to Mercury").Image
("Search Flights").Exist Then
MsgBox "The Image Exists."
MsgBox "Cannot find the Image."
QUESTION: Use of WaitProperty Method
Waits until the specified object property achieves the
specified value or exceeds the specified timeout before
continuing to the next step.
‘The following example uses the WaitProperty method to wait
'Google Search edit box to be enabled before setting its
value to 'QTP Script'.
'If it is still disabled after the test's
'Object Synchronization Timeout time has been exceeded, it
'perform the Set method.
("q").Set "QTP Script"
("Account").WaitProperty("disabled", 0) Then
It is a process of matching the speeds of both QTP and AUT
in order to get proper execution and results.
Where Synchronization is required:
During test execution QTP gives instructions one by one with
same speed, but AUT takes less time for some operations
execution and more time for some operations execution, that
time we may not get proper execution and results. In order
to get proper results in between QTP & AUT synchronization
There are several methods available in QTP for synchronization.
Hello Radhika. i saw U'r answer for synchronization. it is
clear. can U give me a example for wait & synchronization,
i mean stmt for a login, say after giving User ID ,
Password, Submit button is cliked, and any page say page1
is loaded. how to differentiate wait & synchronization when
the page1 is loading?
Synchronization is nothing but time maping between QTP and
synchroization point to give waiting time to the tool(QTP)
Example flight reservation:
1) You are inserting an order and than stop your recording
remember not to close or do any other operation after that.
2)Now playback the same test You find it QTP test result is
generated before order is inserted.
That shows QTP test execution speed is higher than
Application execution speed.
By providing synchronization point tester tries to match
the execution speed of QTP and Application because it may
happen that the next operation that you are performing is
depending on previous result and it is not generated yet.
Default wait time for any object is 20 second and object is
not appearing in 20 second than that may fail script. So to
avoid such condition we use Synchronization Points
in the above one person asked instead of synchronization we
can place wait() statement
there are two problems
1)even though the object is enabled or our required page or
application available it will wait until wait times is
complete. in synchronization we can give the property name
as well as the time. in this if at all one completes either
property or time it will go to the next process.
2)if you give wait time if the wait times is n second and
the application/object time is n+1 then it will show the error.
I have written some script in QTP and i added those objects
in Object Repository. All written script has been executed
successfully. After few days when i tried to execute the
same script i got error message "objects not found in Object
Repositiry". How can we solve this issue?
If we write a script in the expert view how are the objects
created in the object repository?
to be clear i will explain my problem
first i have recorded the mercurytours application by
providing the link www.mercurytours.com and all the objects
are stored in the object repository ok this is fine. but i
have copied the script generated in the above processes and
pasted in a new test and tried to run that script but as
the objects were not stored in the object repository it
showed an error (The "Welcome: Mercury Tours" object was
not found in the Object Repository.
Check the Object Repository to confirm that the object
exists or to find the correct name for the object).so how
can i overcome that error