I am unable to access elements in a pop up on an Android Native App

I have a native app in Android, which I am testing. There is a settings menu button on the top clicking on which the menu opens up, which covers the screen partially.I am able to get the element id/class, etc from the UIautomator for the various elements in the menu. However, once the menu opens up I am unable to get access of elements on the menu from Appium. All operations to get the list of elements by classname/id, returns the list of element present on the homepage of my app(the layer under the menu). How can this be resolved?

Hey there.
I would try:

  1. Launching ARC. (The appium ruby console). Then navigate back to your pop up
  2. Once you are in ARC, type:
    page window: X (X starting at 0 and counting up by 1)
  3. One of these should be your popup with associated elements

I had this problem once on iOS with custom alert views so appium still did not see the pop up with the above strategy. If this happens to you there are workarounds - mainly using execute_script, xpaths or I believe you can find elements directly using uisutomator. A screenshot of uiautomator viewer with your popup would be handy

Let me know what happens

Hi Eric,

Thanks for the reply. I got it working yesterday after multiple retries.
The issue was with API level, I upgraded Android API level to 21 and it now works like a charm. It isn’t working with API levels below 21. Also, I am not using Ruby, I am using Java for my development.

Thanks again,
Neha

1 Like

Hi! I’m working in API23 and using java as well. However, I’m working with browser popups. Do you know how I can change my focus to that popup window in order to access those elements? What was your solution? Thanks!

I am not able to click on button from popup , I did lot of search but not found perfect solution for this below is my UI structure