Is it possible to run automation with screen locked

Best practices, code snippets for common functionality, examples, and guidelines.
Ruser
Posts: 24
Joined: Wed Oct 07, 2009 3:26 pm

Is it possible to run automation with screen locked

Post by Ruser » Wed Mar 24, 2010 5:06 am

I searched this forum but didn't find the similar request, surprised me.

I would like to start the automated test, then lock my machine/screen, go for lunch, come back to see the result. I remember that I can do this with other GUI automation tool like HP winrunner.

I can understand GUI automation needs a desktop, but Ranorex should be able to offer us the flexiblity to lock the machine when the test is running.

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

Re: Feature request : be able to run test with screen locked

Post by Support Team » Wed Mar 24, 2010 10:57 am

Ruser wrote:I searched this forum but didn't find the similar request, surprised me.
IMHO the following forum post already answers this question:
http://www.ranorex.com/forum/mouse-move ... t1170.html
Ruser wrote:I would like to start the automated test, then lock my machine/screen, go for lunch, come back to see the result.
When playing back the standard actions the Ranorex Recorder generates, you must not lock the computer using the default Windows "Lock Screen" mechanism, since this makes all controls unusable, i.e. you cannot use the mouse or keyboard to interact with applications. As an alternative you can disable the physical mouse and keyboard like explained in the post mentioned above.

If you don't use the Ranorex Recorder to record action, but code them yourself, you could also use non-keyboard/mouse actions to interact with UI elements (like Button.PerformClick). These actions can work even if the desktop is locked, however, not all controls support such actions. And some controls forbid such actions explicitly if the desktop is locked or the control is not visible. See the following forum thread covering this topic: http://www.ranorex.com/forum/post4474.html
Ruser wrote:I remember that I can do this with other GUI automation tool like HP winrunner.
What I posted in this thread is perfectly true for HP Winrunner as well. If the desktop is locked, Winrunner can't use the keyboard or mouse on controls, either. From what I know, if the desktop is locked Winrunner just complains that the object is not visible and stops replaying.

Regards,
Alex
Ranorex Support Team

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Feature request : be able to run test with screen locked

Post by Ciege » Wed Mar 24, 2010 4:45 pm

A potential "workaround" for you is to do the following. From your client desktop RDP into the test machine that has the AUT and Ranorex installed. That will lock the main desktop but have an open desktop via the RDP. Then after you test is running you can lock your client desktop. While your client desktop is locked the RDP session will remain open and the tests will continue. I work this way everyday.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Is it possible to run automation with screen locked

Post by omayer » Thu Aug 18, 2011 1:06 pm

Ciege , would you please give us step by step instruction since i am not following "That will lock the main desktop but have an open desktop via the RDP."
Thanks,
Beginner

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Is it possible to run automation with screen locked

Post by Ciege » Thu Aug 18, 2011 3:40 pm

omayer wrote:Ciege , would you please give us step by step instruction since i am not following "That will lock the main desktop but have an open desktop via the RDP."
Thanks,
Beginner
Well, first you need to make an RDP connection to your second computer (I use an RDP client called Royal TS but you can use any client).
Next, set the second computers settings to never sleep and never lock.
Finally, with your test running on the second machine, you can lock your current (local) desktop.

Pretty straight forward...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: Is it possible to run automation with screen locked

Post by omayer » Tue Aug 23, 2011 6:32 pm

Thank you Ciege, now it's all clear