Opening ranorex as a different user

Class library usage, coding and language questions.
Andrew Simpson
Posts: 22
Joined: Thu Dec 03, 2015 11:58 am

Opening ranorex as a different user

Post by Andrew Simpson » Mon Nov 27, 2017 4:02 pm


We have an internal testing environment and our AUT has different configurations based on who you log in as, as part of the test we need to start the application but as a different user so we are prompted for the right screen.

I wanted to do this using the method but don't seem to be having much luck. I don't actually need to login using code so guess its not full blown impersonation just need to be prompted to enter windows credentials

Any help would be appreciated

Code: Select all

Report.Log(ReportLevel.Info, "Application", "Run application 'yourapp' with arguments '' in normal mode.");
            Host.Local.RunApplication("yourapp", "", "", false);
Windows credentials screen.png
Once this screen has appeared then the correct credentials can be entered
Windows credentials screen.png (12.32 KiB) Viewed 1236 times
run as different user.png
Just for clarity im talking about opening the AUT as a different user not RX as my picture shows
run as different user.png (21.7 KiB) Viewed 1236 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: Opening ranorex as a different user

Post by Support Team » Tue Nov 28, 2017 10:15 pm

Hello Andrew,

Have you tried using the Runas command line tool to launch your application as a different user?

Code: Select all

runas [{/profile | /noprofile}] [/env] [{/netonly | /savecred}] [/smartcard] [/showtrustlevels] [/trustlevel] /user:<UserAccountName> "<ProgramName> <PathToProgramFile>"
RunAs.png (5.97 KiB) Viewed 1207 times
I hope this helps!