问题 Background Out automatic tests use views' ids to be able to click on them, so we add ids whenever possible. The problem For popup menus, sometimes it's needed to populate them dynamically, but as I've found, even when I do add id for each item, the id isn't found, and can't be used. Even using DDMS's feature "dump view hierarchy for UI automator" shows that no view in the popup menu has an id. What I've tried This is a sample code of what I use, to try to set an id for the a single menu item.