Wait, property,exist syntaxes with examples.

Showing Answers 1 - 6 of 6 Answers

Wait property
Syntax: Object.waitproperty "property name", "property value", time out.
Example:
y = Window("Test").WaitProperty("focused", True, 3000)
Here we use the WaitProperty method to make the program wait for the "Test" window to become active or wait for 3 seconds (3 milliseconds) to pass, whichever comes first.

Wait is used to initiate a pause during a run session.
Syntax:Wait(time in seconds)
Example
Wait(200 seconds)
The above statement pauses the process for 200 seconds.

Exist is used to return a true/false indicating whether or not an object currently exists.
Syntax:object.Exist([TimeOut])
Example:
If Browser("Mercury Tours").Dialog("Internet Options").Exist Then
MsgBox ("The object exists.")
End If
Here Exist method is uses to determine the existence of the Internet Options dialog box. If the dialog box exists a message box appears confirming its appearance.

Nitin

  • Jun 12th, 2012
 

Wait Property is used for synchronization in QTP.It forces QTP to wait before going to the next step.Suppose an object can display in 5 second and we insert wait(10) then it will allow QTP to wait further more 5 sec.
Browser("Browser").Page("Page").Link("Inbox").Click
Wait(10)

Exist Property is used to check the existence of an an object,whether it exists or not

If Browser("Browser").Page("Page").Exist Then
msgbox objectexist
else
msgbox objectnotexist
End If

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions