This is used when we want UFT to wait for the specified time, so that AUT completes its current operations.It is like pausing the script run for the given amount time(Same like Thread.sleep)
Syntax:- Wait (seconds)
Given script will pause for 2 seconds.
Note:- if we don’t pass any value like wait()
it Will generate runtime error.
|Wait,generated Error for missing Time value|
Using Wait is not considered as good coding practice, because it is like pausing the script independent of any condition and UFT would wait even if the process for which wait was applied have been completed.We can still use it if nothing from the below properties or methods works out , or we are sure that process will always takes a given amount of time.
Is it used to Wait until the the given object property achieves the specified value in the given timeout else it continues to the next step.
Syntax:-object.WaitProperty(PropertyName, PropertyValue, [TimeOut])
Note:- Timeout(milliseconds) is optional,incase it is not provided default synchronization timeout is taken(File->Settings->Run->Object synchronization timeout)
Return Type:- Boolean (True incase property value is achieved in the given Timeout)
It instructs UFT to wait for a specified object to appear.
Return Type:-Returns a boolean value indicating whether or not an object currently exists
Note:- Timeout(seconds) is optional,incase it is not given it would take the default synchronization timeout (File->Settings->Run->Object synchronization timeout)
4.sync Method(Only for Web AUT)
Waits for the browser to complete the current navigation.
How to modify Default Timeout values:-
Note:- Default ‘object’ sync time is 20 seconds and Browser ‘Navigation’ sync is 60 seconds
File > Settings > Web pane
|Changing Browser Navigation Time|
File->Settings->Run->Object synchronization timeout
We can always play with the default synchronization time that UFT takes for Exist,WaitProperty or by default before it throws error to the user.
|Changing Object Sync in UFT|