Page 1 of 1

Disable mouse movement during test execution

Posted: Thu Jan 14, 2010 11:46 pm
by Ruser
Is there any way to diable real mouse movement during executing test? Or is this a feature we might have in the future?

During test execution, I have to ensure there is no pop up window other than the system under test. Otherwise, the mouse click might be wrong.

Also, if I use remote desktop control to execute a test, I can close the window after kicking off the test.

Re: Mouse movement during test execution

Posted: Fri Jan 15, 2010 1:19 pm
by Support Team
Ruser wrote:Is there any way to diable real mouse movement during executing test? Or is this a feature we might have in the future?
Yes, there is a way to disable mouse/keyboard input coming from the physical devices. To do that just set the Keyboard.Enabled and Mouse.Enabled properties to false. Be careful, though, if you disable both keyboard and mouse, because both devices will stay disabled until you set the Enabled property back to true or the automation process ends!
Ruser wrote:Also, if I use remote desktop control to execute a test, I can close the window after kicking off the test.
Please note, that you must not close the Remote Desktop window when you execute an automation via Remote Desktop! When you close the Remote Desktop window, Windows will lock the desktop on the remote machine making automation impossible (mouse and keyboard inputs are disabled completely). If you want to close the remote window, use a VNC system (like UltraVNC) instead of Remote Desktop!

Regards,
Alex
Ranorex Support Team

Re: Mouse movement during test execution

Posted: Thu Apr 08, 2010 4:22 am
by Gunner1980
Where do you use this mouse.enabled disabled at? Do you put this in your program.cs, in recording user code or is this a setting somewhere that you can set at compile time or in a properties page somewhere?
:?:

Re: Mouse movement during test execution

Posted: Thu Apr 08, 2010 9:04 am
by Support Team
Hi!
Gunner1980 wrote:Where do you use this mouse.enabled disabled at?
If you want to disable the input for the whole test cycle, you should set the
Keyboard.Enabled = false;
and
Mouse.Enabled = false;
in the program.cs file. But be careful using the properties, because when you set both to false you cannot abort the test without an AbortKey. So also use
Keyboard.AbortKey = System.Windows.Forms.Keys.Pause;
in program.cs (main mehtod) to abort the test if something unexpected happened for example an endless loop.
Gunner1980 wrote:in recording user code or is this a setting somewhere that you can set at compile time or in a properties page somewhere?
You also can use it for only one recording. In this case you enable/disable this dircetly in user code before you executing some actions. But don't forget to enable it on the end of your recording and use AbortKey.

Regards,
Peter
Ranorex Support Team

Re: Mouse movement during test execution

Posted: Thu Apr 08, 2010 6:37 pm
by Gunner1980
Thank you worked like a charm!