Get application info (FR)
Perfecto command
mobile:application:info
Purpose
Retrieves information about the currently active application on the device.
Use this command to obtain application metadata or device state related to the active application during test execution.
Parameters
| Name | Type | Possible Values | Description |
|---|---|---|---|
|
property |
String |
|
Specifies the application or device property to retrieve. Only one property can be retrieved in a single call. |
Return value
The value of the requested property
Exceptions
None
Examples
Copy
Java sample: Retrieve the active application version
Map<String, Object> params = new HashMap<>();
params.put("property", "version");
String appVersion = (String) driver.executeScript("mobile:application:info", params);
Copy
Java sample: Retrieve the current device orientation
Map<String, Object> params = new HashMap<>();
params.put("property", "orientation");
String orientation = (String) driver.executeScript("mobile:application:info", params);
Copy
C# sample: Retrieve the active application version
Dictionary<string, object> pars = new Dictionary<string, object>();
pars.Add("property", "version");
string appVersion = (string)driver.ExecuteScript("mobile:application:info", pars);
Copy
C# sample: Retrieve the current device orientation
Dictionary<string, object> pars = new Dictionary<string, object>();
pars.Add("property", "orientation");
string orientation = (string)driver.ExecuteScript("mobile:application:info", pars);