Search code examples
androidui-automationandroid-uiautomator

UIAutomator and Android Image Gallery


I am testing my Android app with UIAutomator which works fine for the most screens.

My App opens the Android Images Gallery and the user has to select an image. So I am able to open the Image Gallery with UIAutomator but I am stuck with selecting the image. Here you can see the screenshot of uiautomatorviewer. How can I pick an image (e.g. the first one) from Image Gallery? Am I missing something?

enter image description here


Solution

  • Gallery 3D does not create a View per image but handles the images inside a single custom View, which is the one you are seeing. To pick an image you may click using screen coordinates, not ideal though.