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.
Disable mouse movement during test execution
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Mouse movement during test execution
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:Is there any way to diable real mouse movement during executing test? Or is this a feature we might have in the future?
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!Ruser wrote:Also, if I use remote desktop control to execute a test, I can close the window after kicking off the test.
Regards,
Alex
Ranorex Support Team
- Gunner1980
- Posts: 89
- Joined: Mon Apr 05, 2010 8:44 pm
- Location: Austin, Texas
Re: Mouse movement during test execution
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?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Mouse movement during test execution
Hi!
Regards,
Peter
Ranorex Support Team
If you want to disable the input for the whole test cycle, you should set theGunner1980 wrote:Where do you use this mouse.enabled disabled at?
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.
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.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?
Regards,
Peter
Ranorex Support Team
- Gunner1980
- Posts: 89
- Joined: Mon Apr 05, 2010 8:44 pm
- Location: Austin, Texas
Re: Mouse movement during test execution
Thank you worked like a charm!