Page 1 of 1

Minimizing Virtual Machine while Ranorex tests are running

Posted: Sat Nov 19, 2016 12:11 am
by justletmesignup
Hello all,

I have been searching through threads and blogs but have not been able to find a definitive answer. At this point, I have a feeling that what I am trying to propose/do is not possible but I think I'll pose this question to see if I get any suggestions or further thoughts on the topic.

Machine: Hyper-V VM running Windows 10 Pro
Testing application: Installed software in the VM
Ranorex: Installed in the VM, version 6.1.1

Question:

I have the VM set up with the software we are testing installed onto the OS running in the VM. Ranorex is also installed onto the OS running in the VM. Ranorex tests run perfectly fine in the VM and the tests are passing. However, since the VM is being run on my local machine I was wondering if there is a way for me to minimize/lose focus of the VM's window/display so that I can work on other things, or perhaps, have multiple VMs running on the same computer, all running their own set of Ranorex tests.

In short... 1 physical machine, 3-4 VM's each with their own OS's and Ranorex installed on each of them, each VM has own instance of Ranorex running tests on software being tested.

Thank you

Re: Minimizing Virtual Machine while Ranorex tests are running

Posted: Mon Nov 21, 2016 12:43 pm
by Martin
There is a solution to your problem.

First of all you will need to disable the screen saver for the virtual machine. This can be achived through either persolized settings or in some cases (usually related to terminals) you will need to achive this through regedit.

Then you will have to create a .bat file with the following script:

Code: Select all

%windir%\System32\tscon.exe RDP-Tcp#0 /dest:console
The result will be as followed:

When you run the .bat file with admin rights the remote session will be closed but will not be terminated so it will still be active in the background. And the need for disabling the screen saver is related to the fact that when it gets deployed it will disable the element recognition as well.

Further more it's a good idea to implement a CI tool such as Jenkins or use the Ranorex Agent through which you would start the automation tests. Without either of those you would have to manually start the test and then run the .bat file but this user input might already ruin the test flow.

Re: Minimizing Virtual Machine while Ranorex tests are running

Posted: Mon Nov 21, 2016 5:50 pm
by krstcs
Your other option is to use a VNC server on the VM and use a VNC client (I use TightVNC) to get to it. It is much more stable than RDP and I find it just works better over-all, but your mileage might vary.