Script Execution while System Locked

Ranorex Studio, Spy, Recorder, and Driver.
dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Script Execution while System Locked

Post by dal » Fri Nov 19, 2010 1:12 pm

Hi Team,

Will the script execution happens if I lock my system, I mean I would like to kick-off the script execution, if the script execution is not completed I want to lock my system and look the results on the next day.

Regards,
Dal...

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

Re: Script Execution while System Locked

Post by Ciege » Fri Nov 19, 2010 4:03 pm

1) If you lock your system, scripts that interact with the GUI will fail.

2) If you setup your system to lock automatically after some amount of inactivity, then when a script has completed the system will lock. Much like your system will lock when you don't move the mouse for 5 minutes (or whatever you have your timeout set to).
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...

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Script Execution while System Locked

Post by sdaly » Fri Nov 19, 2010 5:21 pm

Hi Dal

After running your tests simply use the two lines of code below to lock your PC.

Private Declare Function LockWorkStation Lib "user32.dll" () As Long
LockWorkStation


Also, if you have the inactivity lock set then you can use loop the below where ever there are long waits.

Public Sub randomMouseMove()
Mouse.MoveTo(Host.Local.Element, (New Location(random.Next(0, 1000), random.Next(0, 1000))))
End Sub

Hope that helps!
Scott

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

Re: Script Execution while System Locked

Post by Support Team » Fri Nov 19, 2010 7:47 pm

And if you don't want anyone to influence your testing, you can disable the physical mouse and keyboard using the following code:
Ranorex.Keyboard.Enabled = false;
Ranorex.Mouse.Enabled = false;
Only input from the physical mouse and keyboard will be ignored, the only input that is accepted is the Keyboard.AbortKey which will abort the execution (if it is set in your code).

Regards,
Alex
Ranorex Team

dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Re: Script Execution while System Locked

Post by dal » Tue Dec 14, 2010 11:06 am

Thanks all for your suggestions.

In order to handle this situation, we have used a Tool called "Caffine.exe" downloaded from the web, and its activated whenever I perform any execution to prevent the system from locked out.

Regards,
Dal...