WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

XPath Contains does not seem to work with property Name

Open matt-stratt opened this issue 6 years ago • 1 comments

I have the need to find elements using partial text or contains.. I know there are ways to do this using XPath if you are just using the generic Text() but in this case I would like to find an element using the Name attribute..

I have tried things like..

FindElementByXPath("//*[contains(@Name, 'Component_" + field + "')]"))

but this does not seem to work. I have also tried with the lowercase @name, same result.

Oddly enough, this approach does work with the AutomationId property but just not name... Is there something different about this property?

Additionally if there was a way to do this with the common FindElementByName or FindElementByAccesibilityId using a regex or something like that, that would be super useful.

matt-stratt avatar May 04 '20 12:05 matt-stratt

Hi, @Tree55Topz . It is working for me with @Name. Could show Inspector screen?

Shakevg avatar Jul 12 '20 16:07 Shakevg