Script Execution while System Locked : Automation Tools

Script Execution while System Locked

Ranorex Spy, Recorder, and Studio.

Script Execution while System Locked

Postby dal » Fri Nov 19, 2010 2: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...
dal
 
Posts: 72
Joined: Thu Jun 24, 2010 9:59 am

Re: Script Execution while System Locked

Postby Ciege » Fri Nov 19, 2010 5: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
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Script Execution while System Locked

Postby sdaly » Fri Nov 19, 2010 6: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
sdaly
 
Posts: 213
Joined: Mon May 10, 2010 12:04 pm
Location: Dundee, Scotland

Re: Script Execution while System Locked

Postby Support Team » Fri Nov 19, 2010 8: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Script Execution while System Locked

Postby dal » Tue Dec 14, 2010 12:06 pm

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...
dal
 
Posts: 72
Joined: Thu Jun 24, 2010 9:59 am


Return to Automation Tools

Who is online

Users browsing this forum: No registered users and 0 guests

cron