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.
How to find WpfElement if mode is UiaPreferred
Re: How to find WpfElement if mode is UiaPreferred
Hi,
I would suggest to check this post about switching uiapreferred/wpfpreferred mode from code:
https://www.ranorex.com/forum/how-to-se ... t7820.html
I'm not quite sure if it solves your problem, but I think it's worth a try?
I would suggest to check this post about switching uiapreferred/wpfpreferred mode from code:
https://www.ranorex.com/forum/how-to-se ... t7820.html
I'm not quite sure if it solves your problem, but I think it's worth a try?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to find WpfElement if mode is UiaPreferred
That's what I ended up doing right after posting this . Seems to work though it doesn't feel right to change configuration all the time .odklizec wrote:Hi,
I would suggest to check this post about switching uiapreferred/wpfpreferred mode from code:
https://www.ranorex.com/forum/how-to-se ... t7820.html
I'm not quite sure if it solves your problem, but I think it's worth a try?