How to find WpfElement if mode is UiaPreferred
Posted: Tue Aug 15, 2017 11:36 pm
We have a screen in our app where the WPF adapter returns more info than UIAutomation returns. Most of our code is written for UIAutomation so we want to only use the WPF adapter as needed. Using the WPF adapter only is not an option because we have seen problems with old code that can't be changed at this time.
I have tried to call WpfElement.FromPath() but this causes an exception "The element does not support the required capability 'wpfelement'". I assume this is because Ranorex finds the UIAutomation element first in the tree. In Spy I can see two trees, the first for UIAutomation and the second for WPF.
Is there a way to force WPF only mode for one call?
I hope the question makes sense.
I have tried to call WpfElement.FromPath() but this causes an exception "The element does not support the required capability 'wpfelement'". I assume this is because Ranorex finds the UIAutomation element first in the tree. In Spy I can see two trees, the first for UIAutomation and the second for WPF.
Is there a way to force WPF only mode for one call?
I hope the question makes sense.