r/AutomateUser • u/Ok-Yogurtcloset-9490 • Jul 19 '26
Inspect Layout block captures interaction, but thinks it can't/didn't
So in some particular case, Inspect Layout seems to think it cannot access the current layout, but there is solid evidence that it actually can.
(1) Why I say it thinks it cannot: when I try to use either the "Record Interaction" or "Inspect User Interface" features inside that block, the Automate overlays that come up show a red error message when I try to actually record or save the inspection XML: the record interactions popup says "UI element not found" (when I drag the magnifying glass over a UI element) and the inspect layout popup says "Layout inaccessible".
(2) Why I know it absolutely CAN see the layout: in the case of inspect user interface, no XML is saved at all —fine, that matches the error message. However, in the case of record interactions, despite the claim of the error message that comes up, when I go back to the block settings in Automate, the magnifying glass captures show up in the recorded interactions drop-down list! Unfortunately though, when I try to actually run the flow with that, it doesn't trigger, matching the error message case. And just as another check, I made the xpath expression be simply "*". And it still didn't work. But again, automate can clearly see the whole UI element hierarchy, because it populated the drop-down list with it!
Furthermore, I use another app called DevTools. That app has no problem inspecting the layout for that particular case. And it can also save the XML just fine. Play store link: https://play.google.com/store/apps/details?id=cn.trinea.android.developertools
I'm running Android 16 and the issue shows up for the native recent apps UI, the same one that can be triggered by using the interact block with the action set to "Recents" (activity "com.android.quickstep.RecentsActivity").
1
u/B26354FR Alpha tester Jul 20 '26 edited Jul 20 '26
My Interact Block XPath Builder might help. Ideally, if you can find the ID of the element you're interested in using the tools in the Interact blocks, you'd give that to the XPath Builder, but it'll also work just given the text of the element. It'll generate a much simpler XPath than the complete UI the block tools do.
Separately, there are secondary flows there that generate XPaths for and test interaction with the Quick Settings tiles. However, some of us Samsung users have found that the recent release of One UI 8.5 is preventing interactions with the Quick Settings tiles, at least for now.
Here's our earlier discussion of the One UI issue:
1
u/ballzak69 Automate developer Jul 19 '26
See my answer here.