Keeping a computer always active with a small VB application or through TestPartner
We are going to use QA Director to schedule TestPartner scripts to run at various times of the day on a particular computer. If the computer on which scripts are scheduled to run is locked at the time a script is scheduled to start, then the script does not start as the computer will be inaccessible to QADirector. What can we do to ensure that the computer on which scripts are scheduled to run is active always (we do not want to disable the setting to cause it "NOT TO Lock Always" due to security concerns). What we are looking for is a small VB program that runs at the background always in order to keep the computer active always so that scheduled scripts can start at various times?.
Re: Keeping a computer always active with a small VB application or through TestPartner
The best solution would be to get waived the security rule for you: you can promise to lock the computer in a secured room, to put a rotweiler under the desk, etc.
Otherwise, you can write a TestPartner script to keep the computer active. The trick is to make the script move the mouse back and forth every couple of seconds (this simulates the physical use of the mouse and, as Lynne said, prevent the computer to lock).
Something like this:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
Window("Caption=*".Attach 'attach to anything
mouseX = Mouse.X
mouseY = Mouse.Y
Sleep 10, tpPauseSeconds
' Move the mouse to avoid the screen lock
Mouse.Move mouseX + mouseShift, mouseY 'move the mouse
mouseShift = -MouseShift 'prepare the next mouse move
Loop Until (put here the stop condition)
</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">The stop condition may be a key event or existence of a file, or anything you imagine appropriate.
The process can be like this:
1) Launch the above script (manually or via QADirector.
2) When a test script should start, QADirector does something such that the stop condition is satisfied (eg. launches a TP script that presses the key that fires the key event). The mouse moving script stops and then QADirector launches the test script.
2) When the test script stops, QADirector launches again the mouse moving script and thus keeping the computer ready for the next test.
All this can also be scripted in a TestPartner driver script, without using QADirector.