Unable to get the correct enabled/disabled state of a button on Android

We are unable to get the enabled/disabled state of a button on the settings drop-down on Android devices. The drop-down that I am referring to is the one that you get when swiping down on the device’s home screen:

These are just example images, however the settings drop-down looks different depending on the device’s OS version and manufacturer. All the ones that I have tested seem to have the same issue in regards to retrieving the enabled attribute of the button that represents a feature (e.g. Wireless, Mute, Bluetooth, etc).

Usually there is information on a parent object of the button, or on some devices there is another UI element under the button icon (such as a decorative border/bar) that has the value (e.g. “Mute ON” or “Mute OFF”) in the content-desc attribute, but it is not consistent in-between devices/OS-versions.

I’ve tried using Appium’s object-by-id method to get the element and attempt to get the enabled attribute, or parsing through the DOM of the page source, but neither have the enabled attribute return the correct true/false value.

Any suggestions?

The devices that I have tried are Samsung S4 with Android version 4.x (includes both Selendroid and non-selendroid [just Appium using UIAutomator]).

We found the notification shade to be difficult to use and instead use the android settings screens or adb to get the device state. You are correct in observing that Android Fragmentation makes this both difficult and onerous. That’s why they pay us the big bucks to automate android tests, right? :slight_smile:

They do?? :grinning: