Sunday, April 6, 2008

Screen Saver Off

All GUI test suite are not executed if screen saver screen is displayed or machine gets locked. Before running the scripts, automation engineer should confirm not to get the machine lock or screen saver. In few environments, user would not able to control.

Earlier I also faced this problem. Then I used to login as a local user instead of network user or company login id. Later we used VmWare Workstations to run the regression.

You can avoid this situation by few ways.


  1. Using Registry

  2. Using scripting while regression starts

  3. Restart the Machine if system gets locked



Using Registry
It is a simple method. But it should not overriden by your company policy. System Admin may run your company screen savers.
1. Go to HKEY_CURRENT_USER
Path => [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop]
2. Change the following values for following keys.
"ScreenSaveActive"="1"
"ScreenSaveTimeOut"="30000"

Using scripting while regression starts
1. Disable the screen saver. Below code is given for Silktest. Put into ScriptEnter block.
// Declaration
dll "user32.dll"
LONG SystemParametersInfo (LONG uAction, LONG uParam, LONG lpvParam, LONG fuWinIni) alias "SystemParametersInfoA"

// Calling statement
-> SystemParametersInfo (17, 0, 0, 0)

2. Enable the screen saver. Keep below code into ScriptExit function.
// Calling statement
-> SystemParametersInfo (17, 1, 0, 0)

Restart the Machine if system gets locked
User can call any batch script or system restart command. But you need to re-execute the scripts, from where it was stopped. It is a bit complex trick.

No comments: