Objects not identified as WPF

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Thor.Irgens
Posts: 6
Joined: Tue Sep 20, 2016 10:01 am

Objects not identified as WPF

Post by Thor.Irgens » Wed Dec 13, 2017 3:56 pm

Hi,

I have a colleague who tries to find an UI element using WpfImprovedOnly, but the result is returned with UI flavor.
Here the code we try to run

Code: Select all

            RanorexExtensions.UseWpfImprovedOnly();
            TAdapter adap = adapter.GetSingle<TAdapter>(rxPath, timeout);
            RanorexExtensions.UseUiaOnly();
            return adap;

Code: Select all

        public static void UseWpfImprovedOnly()
        {
            Ranorex.Plugin.WpfConfiguration.WpfApplicationTrees = Ranorex.Plugin.WpfTreeSelection.WpfImprovedOnly;
            Ranorex.Plugin.WpfConfiguration.ShowCompleteVisualTree = true;
        }

Code: Select all

        public static void UseUiaOnly()
        {
            Ranorex.Plugin.WpfConfiguration.WpfApplicationTrees = Ranorex.Plugin.WpfTreeSelection.UiaOnly;
        }
The resulting adapter is returned with a UIA flavor, so the children are not as expected.
He is running on Windows 10 (Creator Update) but it has also been reproduce on a Windows 8 machine.
Both are running Ranorex 7.2.0
Both Visual Studio and Spy are run as administrators.

Do you have any idea why this happens? I am running on a Windows 8 and don't have this issue.

Thanks in advance.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Objects not identified as WPF

Post by odklizec » Wed Dec 13, 2017 4:04 pm

Hi,

Could you please post a small sample app and snapshots, both from Win10 and Win8? I'm afraid, there is not much anyone here can do or suggest without the sample app.
Pavel Kudrys
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

Thor.Irgens
Posts: 6
Joined: Tue Sep 20, 2016 10:01 am

Re: Objects not identified as WPF

Post by Thor.Irgens » Thu Dec 14, 2017 8:55 am

odklizec wrote:Hi,

Could you please post a small sample app and snapshots, both from Win10 and Win8? I'm afraid, there is not much anyone here can do or suggest without the sample app.
I believe you can take any app and reproduce the issue on. The constants in all tests here, have been the AUT and code. The difference have only been the machines and their OS versions (all have been Windows), it is a bit hard to provide a sample machine :D.
When performing a find of any kind, where does Ranorex get the flavor it should find it as? I know the setting is available in the spy, but I fear a cache or some access problems to the setting.

Thor.Irgens
Posts: 6
Joined: Tue Sep 20, 2016 10:01 am

Re: Objects not identified as WPF

Post by Thor.Irgens » Thu Dec 14, 2017 10:12 am

I have created a small test application only consisting of UI. I have verified that on the faulty machines the flavor name is UIA, even when the spy is set to WpfImprovedOnly. Also verified on my own machine, that the falvor name is WPF when set to WpfImprovedOnly.

It does seem to be linked to the latest Windows 10 update (Creators), as one of my colleagues had no problems untill the updated was installed, then the same issue was seen.

Uninstalling Ranorex (including the config files in AppData) and reinstalling it Again did fix it for one of my colleagues, the other will try this workaround aswell, to see if it solves it for her aswell.

*EDIT: Typo.
Attachments
TestApp.zip
Test app.
(4.46 KiB) Downloaded 12 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3922
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Objects not identified as WPF

Post by odklizec » Thu Dec 14, 2017 1:35 pm

Hi,

Thanks for the sample. I'm not on "creators" update yet, so your sample works fine form me. I'm getting WPF flavor via Spy. But I'm sure your sample will eventually help Ranorex folks to find the source of problem.
Pavel Kudrys
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

Thor.Irgens
Posts: 6
Joined: Tue Sep 20, 2016 10:01 am

Re: Objects not identified as WPF

Post by Thor.Irgens » Thu Dec 14, 2017 3:20 pm

odklizec wrote:Hi,

Thanks for the sample. I'm not on "creators" update yet, so your sample works fine form me. I'm getting WPF flavor via Spy. But I'm sure your sample will eventually help Ranorex folks to find the source of problem.
You are welcome and thanks for your time :) . My other colleague also solved the problem by just reinstalling Ranorex, so it is not longer a big issue. Just hope the Ranorex guys can figure out the root cause.