battery level, memory and Data consumption

Mobile Testing, Android App Testing.
roey.oren
Posts: 3
Joined: Sun Dec 07, 2014 11:56 am

battery level, memory and Data consumption

Post by roey.oren » Sun Dec 07, 2014 12:12 pm

hi all,

is there any way to get by 'user code' the following things:
1. current battery level
2. memory
3. data consumption

i want to be able to test if my application is using too much from one of the params above.


10x.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: battery level, memory and Data consumption

Post by Support Team » Tue Dec 09, 2014 2:55 pm

Hi roey.oren,

You can get the information about your device by using the following lines of code:

Code: Select all

var app = repo.AndroidApp.Self.As<AndroidApp>();
var info = app.GetDeviceInfo();
Report.Info("Battery level: ",info.BatteryLevelPercent);
It is also possible to get other device information.
Please find more information about Non-UI testing on Android devices in our User Guide in this section.

Regards,
Markus (S)
.
Image