Page 1 of 1

Objects not recognized when run as administrator

Posted: Tue Jan 31, 2017 6:21 am
by annavamsi
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

Re: Objects not recognized when run as administrator

Posted: Tue Jan 31, 2017 8:12 am
by odklizec
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.

Re: Objects not recognized when run as administrator

Posted: Tue Jan 31, 2017 3:20 pm
by krstcs
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.