Some times the application we are automating is very slow, and QTP may run very fast. Now how can we Synchronize the application with QTP .There are three best ways available in QTP .
1. Using Synchronization point :- This is one of the best method, using this we can synchronize against a properity-value pair . For example – We can make QTP wait till any object (say a button) becomes enable while running the application .
2. Using .Exist Method – QTP checks for the existence of an object and then operate on them . It will wait for maximum time specified in exist() method ,if object appears before the maximum time, it will move to the next line . For Example -Browser(“”).Page(“”).Button(“”).Exist(5) ,Here QTP will wait maximum 5 seconds for the button to appear .
3.Using Harcoded Wait statement – Least prefered approach .QTP will forcefully wait for the time specified in parenthesis .Some times suppose we have given a wait of 5 secs for any object, but object appear in 2 sec, then still it will wait for extra 3 secs, which is wastage of time .