What is the use of “SQAWaitForObject”?

Showing Answers 1 - 1 of 1 Answers

Tulika chatterjee

  • Jan 11th, 2007
 

It pauses execution of the script until the specified object can be found.
status% = SQAWaitForObject(recMethod$,timeout&)recMethod$ is the recognition
method values you use to identify an object depend on the object you are
accessing. For example, if you are accessing a push button object, use the
recognition method values listed for the PushButton user action command.timeout&
is the maximum number of milliseconds to look for the object. If the object does
not appear within the timeout period, sqaTimeout is returned. This example waits
up to two minutes for a particular push button to appear.


Sub Main


Dim Result As Integer


Window SetContext, "Caption=MyApp", ""MenuSelect "File->Open..."Window
SetContext, "Caption=Open", ""'


The OK button may take a long time to appear. We can use ' SQAWaitForObject
to synchronize our script without ' increasing the default wait period of all
other actions


Result = SQAWaitForObject("Type=PushButton;Text=OK", 120000)


If Result = sqaSuccess Then


... ' add the rest of the actions/tests here


End If


End Sub

  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