Start application (FR)
Perfecto Command
mobile:application:open
Purpose
Launches an application on the device. Use this function at the beginning of a script to ensure a known starting point for the user.
To use this command, one of the two application identifiers is required. For information on retrieving the application identifier, see Application identifier.
Parameters
Name | Type | Possible Values | Description |
---|---|---|---|
name | String |
|
The application name as it is displayed on the device screen. |
identifier | String |
|
The identifier of the application. |
timeout | Int |
|
The time, in seconds, to wait for the application to start. A zero value will start the application, without any validation or retries, and return immediately. On Android, a value greater than zero will wait for the defined time and fail if the app is not loaded by that time. On iOS the behavior is identical to the default undefined timeout, the command will validate that the application has started on iOS devices only. |
Return Value
None
Exceptions
None
Examples
Copy
Java sample
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
params.put("identifier", "com.google.android.apps.maps");
driver.executeScript("mobile:application:open", params);
Copy
C# sample
//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("identifier", "com.google.android.apps.maps");
driver.ExecuteScript("mobile:application:open", pars);
Copy
Python sample
params = {'identifier': 'packagename_or_bundleid'}
driver.execute_script('mobile:application:open', params)