Erase monitoring information collected so far and start monitoring a given application on regular basis.
- PackageName: Name of application to be monitored or empty string if you just want to erase monitoring information.
This will erase the monitoring information collected so far, and will start monitoring the given application name.
If no application name will be given, only the monitoring information will be erased.
Scenario: We will create a test on the EriBank demo application. During the test run, we will call the startMonitor command so that this application monitoring vitals will be monitored.
- PackageName: Will be set to com.experitest.ExperiBank
on iOS devices, application CPU is the sum of all cores usage. While total CPU is normalized with the number of cores.
Energy monitoring (Beta)
- PackageName: Application bundle ID followed by ':battery'.
Run startMonitor("ApplicationID:battery") to start energy monitoring of an installed application. Battery consumption is estimated based on the following components' usage:
- On iOS :
- location (GPS)
- On Android:
- cpu_power_use (for energy consummed by CPU's operations related to the application).
- wifi_power_use (for WiFi).
- gpu_power_use (for GPU - screen consumption).
- rest_power_use (which groups usage by sensors, bluetooth, cellular, etc).
- total_usage (the sum of cpu_power_use, wifi_power_use , gpu_power_use, and rest_power_use).
- screen_power_use (for power consumed by the screen while the application was running in the foreground).
The data is presented in unit mAh by default, but it can be also presented in percents (relatively to the full battery capacity). Command setproperty("battery.report.percentage", "true") switches the presentation unit to percents. The command is effective on its test only and has no effect on other tests.
If a device does not provide details about battery drain caused by a particular component, N/A is reported as its value.
Supported only for Android versions 5.0+.
Every second a sample containing values for the aforementioned components is taken. The values describe the battery consumption during the time period since the previous sample, i.e., approximately a second. The collected data can be retrieved and exported in CSV format with command getMonitorsData.
Energy monitoring limitations
On iOS devices, Energy monitoring is supported with some limitations:
- Energy monitoring is only supported on local devices, i.e., not cloud devices.
- Monitoring must be started after the application was launched.
- If an application is closed, energy monitoring must be started again by executing startMonitor command.