Monday, 3 March 2014

#16. Blank Screens through CaptureBitmap

#16. Blank Screens through CaptureBitmap

Blank Screens through CaptureBitmap method can be encountered if the system gets locked when the automation scripts are running. To avoid this, it can be assured that the system doesn't get locked when the scripts are getting executed.
This can be done by calling the following function through the automation scripts:-

Public Function AntiSleep()
   Dim iter
   randomize
   iter = randomNumber(0, 100)
   Dim objDeviceReplay
   Set objDeviceReplay = CreateObject("Mercury.DeviceReplay")
   objDeviceReplay.MouseMove iter,300
   Set objDeviceReplay = Nothing
End Function
The above function can be called in an automation script using QTP, and the script can be scheduled to run through control panel recursively.