Minimizing Virtual Machine while Ranorex tests are running

Ask general questions here.
justletmesignup
Posts: 8
Joined: Fri Jul 03, 2015 8:13 pm

Minimizing Virtual Machine while Ranorex tests are running

Post by justletmesignup » Sat Nov 19, 2016 12:11 am

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

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: Minimizing Virtual Machine while Ranorex tests are running

Post by Martin » Mon Nov 21, 2016 12:43 pm

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.
Last edited by Martin on Tue Nov 22, 2016 8:01 am, edited 1 time in total.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Minimizing Virtual Machine while Ranorex tests are running

Post by krstcs » Mon Nov 21, 2016 5:50 pm

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.
Shortcuts usually aren't...