Unable to detect if a checkbox/radiobutton is clicked

I was trying to detect if a checkbox is clicked from Python.
I can find the element with accesibility_id, click it from Python but when I try to check if it is clicked with get_attribute(“checked”) or is_selected(), I got “False”. Later on, I used Appium Inspect and as it is seen in the images, even if a checkbox is clicked, the fields like checked and selected is false.



Before I finish, there is something important I have to mention. I implemented the mobile application that is seen in the images(with Expo React) and I have very limited mobile development skills. If this bug is totally meaningless for someone who is expert than there is a high possibility that the problem related with my app, not with Appium.

when you cant see correct attribute in inspector -> problem in android code. you need ask developer (if it not you) set ‘selected’ correctly when checkbox state changed.

1 Like

Thanks for your fast answer Aleksei.
I realized that if the checkbox is checked when the screen is opened, it is checked in inspector as it should be. For example; I tried the same case with Google Maps. When a screen is open in inspector and I clicked a checkbox its “checked” attribute is False, when I go back in Google Maps, renew the inspector, reopen that page with checkbox in Google maps and renew the inspector now it is checked. So I think this is the case.
I also would like to hear your opinions about that.
Thanks again.

it does not matter. all magic in android code if you do not see correct attribute with Appium inspector or! e.g. with native Android inspector for example layout inspector in AndroidStudio or uiautomatorviewer in tools of AndroidStudio.

1 Like