WPF application not recognized properly

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
mexis
Posts: 1
Joined: Thu Oct 30, 2014 4:15 pm

WPF application not recognized properly

Post by mexis » Thu Oct 30, 2014 4:46 pm

We have a WPF desktop application and we encountered a problem while implementing an aspect of our automation framework.

For various reasons, we start the application as a different user during our automation. We do that, by impersonating a user, which has the same result as clicking on an application and selecting "Run as different user". That way we can test different user permissions and different cases.

So, we are logged in as userA, but the application starts as userB or userC. All the users have the same permissions. When the application would run as userB or C, Ranorex would not find the elements then.

By using the spy and comparing the two applications for some reason they look different. The first one is recognized as WPF, but the second one is recognized as WIN32.

I was able to repro this on Visual Studio 2013 as well and I am attaching the snapshots.

Any idea what might be causing this issue?
You do not have the required permissions to view the files attached to this post.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: WPF application not recognized properly

Post by krstcs » Fri Oct 31, 2014 2:22 pm

Both Ranorex and the system under test should be started under the same user. Different users have different rights to applications. If you use runas (or similar) then the application under test will not be completely accessible to Ranorex if it is not run as the same user.

A better option would be to have multiple virtual machines, each logged in as the user needed, and run the tests there.

On top of that, using runas is not the same as actually running the AUT in the full user session and could present other anomalies that might be problematic for testing. You should always test the same way a user would use the application, otherwise your test may not be a valid indication of actual functionality that the user will have access to.
Shortcuts usually aren't...