Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wait and synchronization in qtp

Tags:

qtp

What is the Difference between wait and synchronization function in QTP. And also please give an idea about what situation wait function can be used , and the situation synchronization function can be used.

Please help me out.

like image 986
Nikhil Surendran Avatar asked Dec 10 '12 10:12

Nikhil Surendran


People also ask

What is synchronization QTP?

Synchronization point is the time interface between Tool and Application under test. Synchronization point is a feature to specify the delay time between two steps of the test script. For example, clicking on a link may load the page is 1 second, sometimes 5 seconds or even it may take 10 seconds to load it completely.

How does UFT handle wait?

Hard Wait in UFTThe Wait method can be used to wait for the specified time. The Wait method accepts time in second as input. For example, when you open the browser and navigate to an URL, it may take 3 to 10 seconds to load the login page completely.

What is the default object synchronization time in QTP?

The synchronization point timeout for a button to become enabled is set to 10000.

What statement can be used for synchronization in UFT?

UFT One must be able to identify the specified object to perform a synchronization point. To instruct UFT One to wait for an object to appear, use an Exist or Wait statement.


1 Answers

Browser.Sync or Page.Sync waits for the navigation to complete, which means that the page has been downloaded completely and successfully. This does not necessarily mean that all of the elements of the page have been downloaded (i.e., images, CSS, JS).

Wait is a hard-coded delay (wait X number of seconds). Wait should be avoided as much as possible. The script will run faster and more reliably if you use the built in synchronization functions of QTP (WaitProperty or Sync).

Taken directly form the QTP help text, below is a code example which displays an ideal time to use a Browser or Page level Sync.

SystemUtil.Run "iexplore.exe", "http://www.google.com"
Browser("Google").Page("Google").Sync
Browser("Google").Navigate "http://www.cnn.com"
Browser("Google").Page("CNN.com - Breaking News,").Sync
Wait 10 ' we can read the latest news
Browser("Google").Back
like image 103
BrianJM Avatar answered Dec 14 '22 01:12

BrianJM