Ask a Question

Programming Around A Screen Saver

Frequent Contributor

Programming Around A Screen Saver

I tried two different methodologies.


i have a routine that moves the mouse occasionally. Each loop in my process. I then call this simple routine.


def MoveMouse():
Sys.Desktop.MouseX = Sys.Desktop.MouseX + 1


As well as 

Win32API.SystemParametersInfo(Win32API.SPI_SETSCREENSAVEACTIVE, False,"Null",0);


In theory they should work. They do not. I get no error.


Champion Level 2

You don't want to just shut off the screensaver manually on that machine?

  • If there are long pauses between test actions in your distributed tests, make sure that the screen saver, power saving options and lock screen are disabled. Otherwise, TestComplete will fail to continue the test run after the computer is locked.



Frequent Contributor

Of course I do. I work for an Agency that controls that type of thing.



What about direct registry edit (from the scheduled task?) to disable screensaver ?


  /Alex [Community Champion]
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.

I have to ask because there is no "of course" around here!  You might or might not be surprised at what people want to spend days automating when they could just turn it off.  


There's an example in this archived thread that is similar to one of yours.  @HKosova is pretty good at this stuff.  😉

Sub Test

  Set timer = Utils.Timers.Add(900, "Unit1.MoveMouse", True)


  ' Do something

End Sub


Sub MoveMouse

  Sys.Desktop.MouseX = Sys.Desktop.MouseX + 1

End Sub


Showing results for 
Search instead for 
Did you mean: