The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach. |
Description
Delays the test execution until the specified process appears in the list of processes running on the given Android device or until the specified timeout period elapses. If the specified process is found, the method returns the appropriate AndroidProcess
object. Otherwise, it returns a stub object.
TestComplete recognizes processes of only those applications that were prepared for testing in a special way. For more information, see Preparing Android Applications (Legacy). |
Declaration
AndroidDeviceObj.WaitProcess(ProcessName, Timeout)
AndroidDeviceObj | An expression, variable or parameter that specifies a reference to an AndroidDevice object | |||
ProcessName | [in] | Required | String | |
Timeout | [in] | Optional | Integer | Default value: 0 |
Result | The AndroidProcess object |
Applies To
The method is applied to the following object:
Parameters
The method has the following parameters:
ProcessName
Specifies the name of the desired process, that is, the full name of the corresponding package (for example, com.example.orders).
Timeout
The number of milliseconds to delay the script execution in order to allow the package to start. If Timeout is 0, the method searches for the desired process once and then returns immediately. If Timeout is -1, the waiting time is infinite.
Result Value
The AndroidProcess object. If the specified object does not exist, the method returns an empty stub object.
Remarks
Unlike the Process
method, WaitProcess
does not post an error message to the log if the desired process does not exist. It simply returns an empty stub object. Use the Exists
property of the returned object to determine whether the desired window exists in the system. If the process exists, its Exists
property will return True; the property of the stub object will return False. Note that calling any method of the stub object will cause an error.
Example
To view an example that demonstrates how to use the WaitProcess
method, see Waiting for Objects in Android Open Applications (Legacy).
See Also
AndroidDevice Object
AndroidProcess Object
Process Method
Testing Android Applications (Legacy)
WaitProcess Method (iOS Testing)