how can u put synchronization point in qtp,wat is exactly
synchroniztion why we use it wat is benifit in qtp

Answer Posted / kamakshya prasad podh

QUESTION: what are the different opens that we can use to
synchronize the test?

Answer: By using
i) Synchronization Point i.e Sync
ii) WaitProperty Method
iii) Wait Statement/Exist statement

QUESTION: Use of Synchronization i.e Sync Method

Answer:
‘The following example uses the Sync method to complete the
navigation to the specified page.


SystemUtil.Run "iexplore.exe","www.cnn.com"
Browser("Google").Page("CNN.com - Breaking News,").Sync
Browser("Google").Navigate "http://www.cnn.com/"
Browser("Google").Page("CNN.com - Breaking News,").Link
("Health").Click
wait(10) ‘wait for 10 sec
browser("Google").Back

QUESTION: Use of Exist Method

‘The following example uses the Exist method to check
whether the
'Search Flights image exists five seconds after it clicks
the
'Login image.


Browser("Mercury Tours").Page("Mercury Tours").Image
("Login").Click 0, 0
Wait (5)
Browser("Mercury Tours").Stop
If Browser("Mercury Tours").Page("Welcome to Mercury").Image
("Search Flights").Exist Then
MsgBox "The Image Exists."
Else
MsgBox "Cannot find the Image."
End If

QUESTION: Use of WaitProperty Method

Waits until the specified object property achieves the
specified value or exceeds the specified timeout before
continuing to the next step.


‘The following example uses the WaitProperty method to wait
for the
'Google Search edit box to be enabled before setting its
value to 'QTP Script'.
'If it is still disabled after the test's
'Object Synchronization Timeout time has been exceeded, it
will not
'perform the Set method.


If Browser("Google").Page("Google").WebEdit
("q").WaitProperty("disabled",0) Then
browser("Google").Page("Google").WebEdit
("q").Set "QTP Script"
browser("Google").Page("Google").WebButton("Google
Search").Click
End If
'If Browser("google").Page("index").WebEdit
("Account").WaitProperty("disabled", 0) Then
' Browser("index").Page("index").WebEdit("Account").Set
("123")
'End If

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to make qtp understand the difference amongst the same type of objects .suppose there are 5 check boxes in a page and I have to choose the 2nd one, how to do that through script?

562


How to use the object spy in quicktest professional 8.0 version?

542


While spliting an action in QTP 10.0 getting an error : "This Line is a part of Script Block.You cannot split the action on this line." how to re-solve this and split the script into actions?

1418


how can i pass a "automation script" as a parameter in a function give me need full suggestion thank inadvance

1424


how to prepared for first for the first interview?

1792






What are the different types of recording modes in qtp? Which will be used when?

560


How to run a test using quicktest professional (qtp)?

537


Difference between copy to action and call to action?

584


How will you find the current time of the remote machine using QTP script?

591


What is action?

571


How to capture dynamic values in load runner and how Each of the captured values are to be written to a text file (c:\temp\LoadRunner1.txt)

1732


Where is the resultset of a sqlquery (which is fired by rsobj.open sqlquery,xxxx,xxxx) stored ?

1858


What is the use of "New Property" in "Add properties" of testobject properties in object repository. How can i use "New properties" while writing scripts if i have assign some values to the testobject properties Can anyone help me? plz

1472


I want to know what are QTP functons and what are VB script functions. What is the difference between them.When we have to use these functions.

1298


What if recovery scenarios is also failed for identify the alert ? (We are handling unexpected popup through recovery scenarios but if still recovery scenarios also failed than what should be the approach)

1009