Object synchronization is one of the important aspect in
Quick Test Pro , While working with Web.
The details to the topic are as below.
1.
What is synchronization?
a.
When we consider QTP application , it has its
own speed of running and the application under test has its own speed, To Synch
that’s to match the running speed to QTP with Application Under Test we need
synchronization points.
2.
Why we need synchronization?
a.
We need synchronization to match the speed of
application under test and QTP.
3.
How to synchronization and what are different
ways to synchronize.
a.
The different ways to synchronize QTP with the
AUT are
i.
Using Wait() statement.
1.
The Syntax to use Wait(Sec), Where “Sec “ it’s
the time in term of second for which you want application to wait/pause the
execution.
ii.
Using .Exist
1.
When you use .Exist, the default execution pause
time is 20 seconds, However still this can be altered, by Changing QTP setting
s By navigating to File->Setting->Run , You need to enter the value in
the field “Object Synchronization timeout”. Unit is seconds. You can change the
value in this field and Click on apply to reflect the changes.
iii.
Using Wait property.
1.
Wait property is basically used when you want
application to wait for a certain time or the property of an object is changed.
Simple syntax to use wait property is “Object. WaitProperty(
"attribute/readyState"
,
"complete"
,
4000
WaitProperty("attribute/readyState",
"complete", 8000)”
iv.
Using .Synch
1.
The syntax to use .Sync is Object.Sync, This pauses the QTP execution for the default time out set in “Object Synchronization
timeout” field of File->Setting->Run
v.
Using loops.
1.
We can also make QTP to wait by using loops, the
simple example is using do loop.
Do
myObjProperty=Browser(“browser”).Page(“page”).WebEdit(“webedit”).GetROProperty(“visible”)
Wait(1)
Loop While myObjProperty =False
4.
Where to use Synchronization?
a.
Typical use of application of synchronization is
when application speeds are not matching, or you have two different
applications running in a single browser.
I hope this article has sufficient information on
Synchronization. If you need anything specific, Please don’t hesitate to post.
Or even you want me write article on any specific module,
your suggestions are most welcome.