0

I am trying to automate some UI testing for my company. I have written an automation that goes through an entire process. It does everything I need. I am using the Sikuli API from my Java code to do this.

Now, my problem is that my mouse is hijacked during the test process. It would be convenient if I could run these tests without my mouse being affected. My first thought was to run the tests inside a VM and control the "VM Mouse" using the automation instead of running the tests from my desktop and controlling my "Desktop Mouse".

I have seen a few questions and links on this topic, but none with a clear answer. Is it possible to do this? If so, how? Keep in mind any solution works - it doesn't have to be Java or Sikuli, I just want to know if it is possible to automate mouse movement inside a VM without affecting my "real" mouse.

nhouser9
  • 6,730
  • 3
  • 21
  • 42

1 Answers1

1

You can't ask a question about something you've done using Sikuli and then say that it doesn't have to be Sikuli. If you are generally interested in a way you can run headless or remote desktop automation, just ask it as it is.

Saying that, you can't use Sikuli without sacrificing your screen and mouse. The reason for this is Sikuli implementation which is done by utilizing the Java Robot class that takes control of user input to interact with underlying software.

There is an attempt to work around this limitation using a VNC. It is described here.

Community
  • 1
  • 1
Eugene S
  • 6,709
  • 8
  • 57
  • 91
  • I'm not asking a question about something i've done with Sikuli. I am stating a problem I have. I am unable to solve that problem with Sikuli. I am looking for any solution to that problem. The info about Sikuli is to show my prior research and attempts to solve the problem. If you think it would be best to remove the Sikuli tag, feel free to edit. – nhouser9 Aug 18 '16 at 01:13
  • I also don't care about using Sikuli without a monitor (the link you shared). I only care about whether there is any method in existence whatsoever to automate VM mouse movement without interfering with my physical mouse. – nhouser9 Aug 18 '16 at 01:16
  • @nhouser9 Generally, if you run your automation on a separate machine (as a VM for example), it wouldn't interfere with your mouse. The limitation in case of Sikuli though, is that it just wouldn't work as it requires a physical output device (screen) attached to it. The VNC approach is supposed to fix that limitation. – Eugene S Aug 18 '16 at 01:19
  • So two questions then. 1. If that's the case, why can't I just use sikuli from within the VM to control its mouse, and hook the VM up to a monitor? 2. when you say "generally... it wouldn't interfere with your mouse" how would you do that then? Automate clicks within a VM without interfering with your mouse? – nhouser9 Aug 18 '16 at 05:03
  • @nhouser9 I apologize, I just went through my previous comment and realized that I got it wrong. If you can set up a dedicated machine with a screen to run Sikuli on, you won't have any problem. If you just connect an additional screen and run a VM inside a VirtualBox or something, you are still sharing your mouse with it and you won't be able to use your mouse for another tasks. – Eugene S Aug 18 '16 at 05:59