Thursday, November 27, 2014

Synchronization Points

When AUT takes some time to respond to an action, QTP might execute the next steps for which the application is not yet ready. In this situation QTP might throw an error. Normally we see "Object is disabled" message.

In this case, synchronization points are used to pause the script to execute certain steps in the test.

There are 4 different types of Synchronization points...

First : 

Browser("....").Page("...").WebList("List").Select "Something"

'Wait for page to load
Browser("...").Sync

'Perform next actions in the scripts
Browser("...").Page("...").WebButton("ButtonName").Click

Second:

Browser("....").Page("...").WebList("List").Select "Something"

'Wait for page to load
Wait 2 ' Waits for 2 Seconds

'Perform next actions in the scripts
Browser("...").Page("...").WebButton("ButtonName").Click

Third:

Browser("....").Page("...").WebList("List").Select "Something"

'Wait for max 5 seconds or until the button gets enabled, whichever is lesser
Browser("...").Page("...").WebButton("ButtonName").WaitProperty("Enabled",True,5000)
Browser("...").Page("...").WebButton("ButtonName").Click

Four:

Browser("....").Page("...").WebList("List").Select "Something"

'Wait for max 5 seconds for button to appear/enable
bAppear = Browser("...").Page("...").WebButton("ButtonName").Exist(5)

'Verify the button exist 
If bAppear Then
Browser("...").Page("...").WebButton("ButtonName").Click
Else
'Report the message to QTP Results
End if



No comments:

About Me

My photo
Hi all,I am Arun Singh Rajaputra. I am working as a Project Lead in a reputed organization in Hyderabad, AP, India. I have little bit knowledge on Quick Test Professional and like to share my knowledge to all through this blog.

Subscribe to get updates on this blog

Enter your email address:

NOTE

Some of the posts posted in this blog are collected and most of them have been prepared by me. If any one have objections regarding any copied posts. Please mail me so that I can take a necessary action on that post.