How to Stop Screen Lock using QTP

This code is written and donated by Aditi.The objective of this code is to combat the screen saver activated while running for the long execution..(say--4000 lines of row)

This sample piece of code gives a mouse move which stops to activate screen saver.


Function Handle_SystemLock(Object, Method, Arguments, retVal)
Set o=CreateObject("Mercury.DeviceReplay")
o.mouseMove second(now),100
Set o=Nothing
End Function




Thank you aditi for the help and donation of the code.

Some more technique can be used...

use runtime co-ordinates "x" and "y" with mercury device replay feature,this should help u click on the item.

eg.


xcord=Browser("ABC").Page("XYZ").getroproperty("x")
ycord=Browser("ABC").Page("XYZ").getroproperty("Y")
set obj=createobject("Mercury.devicereplay")
obj.mousemove xcord + somevalue , ycord+somevalue
obj.mousedblclick xcord + somevalue , ycord+somevalue,0

How to Stop Screen Lock using QTP How to Stop Screen Lock using QTP Reviewed by Animesh Chatterjee on February 08, 2009 Rating: 5

1 comment:

  1. Nice one...thanks aditi and animesh for your effort....it gave me a chance to go out from my seat while the execution is going on.

    Fantastic approach.


    alen

    ReplyDelete

Powered by Blogger.