Objects not recognized when run as administrator

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
annavamsi
Posts: 18
Joined: Wed Sep 14, 2016 10:55 pm

Objects not recognized when run as administrator

Post by annavamsi » Tue Jan 31, 2017 6:21 am

Hi,

I am facing an issue where in when I try to run the tests as administrator using psexec or opening cmd as administrator then tests will fail (object reference error).

When I run the tests as normal user the test will pass without any issues.

Note:- I cannot start my application as administrator and I cannot change Ranorex version as this is the version we have to use.

I have to run the tests as administrator in order to get performance counter values. I have no other choice.

Ranorex Version:- 5.4.4
Windows 10
Technology C#, WPF

Regards,
Vamsi

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

Re: Objects not recognized when run as administrator

Post by odklizec » Tue Jan 31, 2017 8:12 am

Hi,

As I mentioned in your other post, Ranorex 5.4.4 is too old and no longer supported.

Additionally, without Ranorex report or detailed explanation what exactly fails (failing xpath) and Ranorex snapshot (not screenshot!) both from app started as normal and admin user, there is nearly nothing we can do for you. Apparently, the xpaths are different in app started as admin, hence the recorded xpaths (recorded as normal user) fails.

Please post a Ranorex snapshot of the failing element (both from app started as normal and admin user) and report from failing test. Without theses essential things, it's impossible to provide any help.
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

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

Re: Objects not recognized when run as administrator

Post by krstcs » Tue Jan 31, 2017 3:20 pm

Ranorex automation and the Application under tests (AUT) MUST BOTH BE STARTED UNDER THE SAME USER LEVEL CONTEXT!! This is pointed out in the User Guide: http://www.ranorex.com/support/user-guide-20.html.

You cannot start Ranorex as admin and the AUT as a normal user, or the other way around. This causes issues with recognition as you have seen. Both must be started as the normal user or as administrator. There is no way around it. (Note: This applies to ANY UI automation tool, not just Ranorex. Windows does not allow access to some parts of applications from another application when they aren't started under the same user context.)


In addition, Ranorex is not a performance testing tool. You should use an actual performance testing tool if you want those kinds of metrics. Ranorex is a FUNCTIONAL UI Test Automation system. It is not designed for, and actually interferes with, performance testing.


And, as has been pointed out several times, if you want meaningful support, you must upgrade to a currently supported version. 5.4.4 is no longer supported and should not be used. 6.1.1 and 6.2.1 are the only supported versions currently.
Shortcuts usually aren't...