Appium Testing for charging and discharging of battery in android phones

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.

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:

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

Does Appium supports NFC Testing ?

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.

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.

For smart switches, I was referring to things like these (for home automation):|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:

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.