layout inspector to interact xPath

221 views
Skip to first unread message

Solomon M

unread,
May 9, 2021, 12:06:59 AM5/9/21
to Automate
How do I determine the XPath from the layout inspector?

the record actions option doesn't seem to get the action of certain clicks, and i do not know what i need to put in xPath from the layout.

Henrik "The Developer" Lindqvist

unread,
May 9, 2021, 1:06:39 AM5/9/21
to Automate
Either write them manually, based on the XML from the "Inspect layout" button, or use the "Record interaction" button in an Inspect block, to generate it.
The "record interaction" window has a new Search icon, which can be dragged to any UI element shown on screen, generating an Inspect action with the XPath expression for it.
Copy that XPath expression to your Inspect layout block, them modify it to extract/select the attribute, e.g. text, you need.

I'll probably add a "Record interaction" button to the Layout inspect block as well.

Solomon M

unread,
May 9, 2021, 2:17:46 AM5/9/21
to Automate
Awesome! Wow, didn't notice that before.

When attempting to click "Show cached processes"
In dev settings under running apps, I can get it to show but not to click. How do I use the output variable from the inspect block to target that? The inspect is what shows as the action.

How do I determine with the layout what the xpath is for what I want? I've been looking at it from all angles and don't know how to manually create that path from the layout.

That search feature is super nice, tho changing the automatically selected "inspect" action to "click" doesn't seem to do it.

Thanks for all your help!

Henrik "The Developer" Lindqvist

unread,
May 9, 2021, 5:24:31 AM5/9/21
to Automate
There's no "output variable" for a target UI element, there never was.
The "Inspected content" output variable is assign text content of the inspected UI element, like it always done.

As said, if you don't know how to write an XPath expression for "selecting" in a XML document/layout, then use the "Record interaction" button.

Please post the XPath expression generated.

denis....@gmail.com

unread,
May 20, 2021, 2:52:48 PM5/20/21
to Automate
Hello Herink,

Are you saying that xPath can't chose between UI element, which one to target ? 

I remember there was a VM Interact Block nth-element on the to-do list. Was it implemented at the same time than xPath interact ? Would love that feature but can't seem to find it 

Thanks ! 


Henrik "The Developer" Lindqvist

unread,
May 20, 2021, 5:02:43 PM5/20/21
to Automate
No that's not what i said.
XPath can indeed "target" any UI element, the nth-element, or whatever the expression does.

denis....@gmail.com

unread,
May 22, 2021, 9:13:03 AM5/22/21
to Automate
Ok that is great. Have to learn XPath then !
Reply all
Reply to author
Forward
0 new messages