Appium Testing for charging and discharging of battery in android phones


#1

Hi I am new to appium . Can anyone suggest me how to test Power charging and discharging in android phones using appium. What are all possible test that can be carried out using appium in mobile devices.


#2

You cannot do proper battery tests with Appium.

For that you should use specific hardware to really measure what device is consuming with app running vs without app running. For instance:
https://www.msoon.com/LabEquipment/PowerMonitor/


#3

Thanks for the information. What is incoming qc level and outgoing qc level. how can we test it using appium?


#4

Does Appium supports NFC Testing ?


#5

While Appium can’t alone test battery, it can however be used to drive battery discharging by performing actions on device like:

  • running automated tests/actions against some app
  • adjust screen brightness
  • adjust audio volume
  • for driving/running some app, use something CPU/memory intensive (game, video playback, hardware benchmark software)

And combined with good hardware test setup, could also drive device charging of battery as well (e.g. hook up device to cable & USB charger but have this charger controlled by a “controllable” on/off switch (e.g. smart switch/outlets). Hopefully such switching setup can be controlled via API (or otherwise smartphone app, website, etc.). This way you can control when to charge battery powering switch/charger on and when to let it discharge w/ switch/power off.


#6

Can you give some more information on such smart switches. Have you really used them ? looks like a nice idea but don’t know if it is practically possible to control electrical switches via API.


#7

For smart switches, I was referring to things like these (for home automation):

https://www.amazon.com/Wireless-Compatible-Appliances-Function-Protection/dp/B078M4WHPP/ref=asc_df_B078M4WHPP/?tag=hyprod-20&linkCode=df0&hvadid=242041198988&hvpos=1o1&hvnetw=g&hvrand=2850251753363520077&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9032135&hvtargid=pla-402982793681&psc=1

https://www.homedepot.com/p/Switchmate-Light-Switch-Rocker-White-RSM001W/300831596?cm_mmc=Shopping|G|VF|SmartHome|Multi|NA|PLA|TopSKUs|NEW|71700000043519444|58700004578304380|92700038431234244&gclid=Cj0KCQiAzePjBRCRARIsAGkrSm7PsvlMUTdaCfYRkAr3pbQV140--9lQ_W0ddoeQ3hzs6OGAcnzVfjEaAgFOEALw_wcB&gclsrc=aw.ds

Simply search for terms like “smart switch” and other terms about (or filter for/by) electrical plug/outlet/adapter, etc.

However, I’m not sure if manufacturers make much of any version that are plug in adapter switches where you just plug in wall outlet and it is a pass through outlet with control to disable the adapter (on/off for power). Others would be wall switches that control an outlet on the wall near it. Wonder if there are much of any smart surge protectors (multiple power outlet extenders), something like:

https://www.amazon.com/TP-Link-Smart-Outlets-HS300-1-Pack/dp/B07G95FFN3/?gclid=Cj0KCQiAzePjBRCRARIsAGkrSm6o9-QWtjyNCx_Dpyw2WAap2qD6pzmzDbFhK7poKw4RYpt2d0GVBqYaAmw2EALw_wcB

But in any case most of these advertise control via smart phone app, Alexa, Google Home. The trick would be to reverse engineer/sniff the actual APIs they use to control the device so that you don’t have to use the smart phone app or Alexa/Google, and go direct by calling the APIs. Would be nice if the vendors just released the APIs publicly.