WinAppDriver stops discovering items if TargetType is Button
We have an issue we've encountered where WAD can't seem to see the internals of certain XAML items.
The attached XAML is used to create an object that has 2 images and several TextBlock items inside of it.
Inspect.exe, and by proxy UIA, can see the items inside of it, but when we try to access them with WAD, only the images are discoverable. Even if I get a reference to the parent Button and try to do a wildcard xpath on the object for its children as a last resort, I'll only get the images.
I'm not sure if it's accurate, but I have a theory that the problem is that because it's turning items into HTML equivalents under the covers, and the
Is this fixable?
I asked here as well, but that seems to have gotten lost.

Try a different version of WinAppDriver.
Is there another developer that makes a product called WinAppDriver? Because I've tried multiple versions of this one.
I'm having the exact same issue. I have a custom control derived from button. In the xaml it calls for a style which sets the template with some textblocks etc. inside. Nothing below the Button is seen by winappdriver despite being seen in Inspect.exe. I even wrote my own AutomationPeer for the custom button and crawled its children adding them to the list in GetChildrenCore(). I watch it populate the list with my text boxes (they contain status which I need for my tests) and return the list correctly in the debugger. WinAppDriver still responds with only the parent when calling elem.FindElementsByXPath(".//*"); I'm seeing this in a few other places as well with styles that set a ContentTemplate.
I'm having the exact same issue. I have a custom control derived from button. In the xaml it calls for a style which sets the template with some textblocks etc. inside. Nothing below the Button is seen by winappdriver despite being seen in Inspect.exe. I even wrote my own AutomationPeer for the custom button and crawled its children adding them to the list in GetChildrenCore(). I watch it populate the list with my text boxes (they contain status which I need for my tests) and return the list correctly in the debugger. WinAppDriver still responds with only the parent when calling elem.FindElementsByXPath(".//*"); I'm seeing this in a few other places as well with styles that set a ContentTemplate.
Oh and I've tried WinAppDriver 1.2.1 and 1.2.99 (current 1.3 release candidate).
I'm having the exact same issue. I have a custom control derived from button. In the xaml it calls for a style which sets the template with some textblocks etc. inside. Nothing below the Button is seen by winappdriver despite being seen in Inspect.exe. I even wrote my own AutomationPeer for the custom button and crawled its children adding them to the list in GetChildrenCore(). I watch it populate the list with my text boxes (they contain status which I need for my tests) and return the list correctly in the debugger. WinAppDriver still responds with only the parent when calling elem.FindElementsByXPath(".//*"); I'm seeing this in a few other places as well with styles that set a ContentTemplate.
Oh and I've tried WinAppDriver 1.2.1 and 1.2.99 (current 1.3 release candidate).
I've found this to be true throughout our code. Any button which has a style set with content doesn't contain those elements when GET-ing that button element from WinAppDriver. Inspect.exe can see them but the button element is empty from WinAppDriver. I've attached a small VS project with a WPF app with a single button that has a style with a ContentTemplate which has a textbox. The contents of the textbox are set to ON or OFF depending on whether the button is active. There's also a test which connects to an IP where WinAppDriver is running that tries to find the textbox, which it can't. Going to experiment with different versions of things next but it does really look like WinAppDriver that's just not finding it. (also verified that Inspect can see the textbox in my sample app). winappdriverbug.zip