Support for login and logout of windows

Ranorex Studio, Spy, Recorder, and Driver.
Posts: 1
Joined: Thu May 08, 2014 1:57 pm

Support for login and logout of windows

Post by yflint » Thu May 08, 2014 2:14 pm

I hope I'm posting in the right area in the forum.
I am looking for a way to support tests that include logout and login to windows.
I want to conduct tests on one windows user and then logout and login with another user and run the same tests again.
Thank you

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

Re: Support for login and logout of windows

Post by Support Team » Mon May 12, 2014 4:15 pm

Hi yflint,

In my opinion no test software is able to logout and then login on the same machine since the test application will be closed after logging out. but it may be able to split the test up.
One part could make the login and logout by using remote control and the other part could run on the specific application to execute the specific machine related steps.
So it may work when you remote connect to the machine somehow start the test and login and then logout by using image based automation, but this is not really recommended but maybe the only chance to automate such a scenario.


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

Re: Support for login and logout of windows

Post by krstcs » Mon May 12, 2014 4:47 pm

I agree with Markus. It is not possible, given the way Windows is designed, to do this with any UI automation system.

I would recommend that you look into using a continuous integration solution such as Jenkins. You can set Jenkins to run your test, then run a batch file (powershell works well) that logs the user off. You can have another script that is run on a different system that uses remote desktop to log into the systems before the next test. Try using "rdp.exe" (do a search for it) as it will allow passing username/password into the rdp session for login.

The process would look like this in the Jenkins job(s):

1. (Job 1) On master (Windows) system, run "rdp.exe /v:<address or hostname of test system> /u:<username> /p:<password>". (You can parameterize the address/username/password in the job.)
2. (Job 2) On the system under test, run your test application.
3. (Job 2) On the system under test, run the logoff script.
4. Repeat 1-3 as needed for users.
Shortcuts usually aren't...