Wait or Sync which one is better in QTP or UFT??

Facing problem with Syncronazation with AUT is most common for Automation Test Engineers..

Well to be very frank,Even i had struggled very much with this...

let me tell you what is wait..
Wait:This command is used to stop QTP(forcefully) for the specified time.If you are very sure within that time frame the Application is bound to open ,It is very smart to use it.


It can not be used to any client based viz window based application.But the main problem is if the application appears before your wait time,then you loose time.and if the other things happens that means you loose control.

Sync:This command is var efficient than Wait...may be solve the problem of wait.This command interacts with application and give full time to load it.But i have seen scripts failing inspite of having a sync command.

To my point of view the best approach is
'*******************************************************************************************************************'METHOD NAME : F_Sync
'ARGUMENTS : obj,Max_Wait,result
'DESCRIPTION : Waits for Oracle Navigator
'RETURNS : None '*******************************************************************************************************************Function F_Sync (obj,Max_Wait)
Dim Wait_Time flag_wait = "False"
If obj.Exist(2) then
Else Wait_Time=Wait_Time+5
If Wait_Time> Max_Wait Then
Exit do
End If
End If
loop until flag_wait = "True"
End Function
obj will be
Set obj=Browser("ABC").Page("VCV")

Wait or Sync which one is better in QTP or UFT?? Wait or Sync which one is better in QTP or UFT?? Reviewed by Animesh Chatterjee on January 04, 2009 Rating: 5

No comments:

Powered by Blogger.