Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run automated GUI tests on a remote headless ESXi Virtual Machine?

I'm trying to setup automated GUI tests in ESXi Virtual Machines using TestComplete. The problem, as I understand it, is that when no remote desktop connection is made to the ESXi virtual machine, then it is impossible for TestComplete to perform screen captures and therefore automate the GUI testing. As far as I understand it, this is due to the fact that Windows does not generate any user interface when nobody is viewing it.

I'm sure other have experienced this problem. How did you solve it ? Are you using a third party computer which automatically launch remote desktop connections prior to running the tests ?

Would it be possible to launch a remote desktop from a head-less virtual machine to another to fake somebody viewing ?

Any other smarter solutions I haven't thought about ?

like image 589
jonjbar Avatar asked Sep 14 '11 16:09

jonjbar


1 Answers

You should be able to log in to Windows on the VM's console using the vSphere client, then close vSphere, and Windows will still believe the user is viewing the console. Simple as that. :)

So there shouldn't be a need to involve remote desktop in the mix.

As long as your tests then run as that logged-in Windows user, you should be fine.

This technique has always worked like a charm for me with certain Watir, Selenium, and MS UI Automation tests that depend on having an interactive desktop.

If you need to reboot the VM automatically before/during the test, instead of logging in manually in the vSphere client, you can make Windows log in as an arbitrary user automatically - check the "control userpasswords2" command, or you can use the Sysinternals app "Autologin":

http://technet.microsoft.com/en-us/sysinternals/bb963905

Only catch with this technique is that you need to be able to launch your tests while not viewing the console on the VM, but it sounds like you've already taken care of that?

If you need a solution for launching your tests remotely, I highly recommend using Jenkins or Hudson to kick off tests/collect results from the VM. Jenkins has changed my life in this regard.

like image 152
Bill Agee Avatar answered Nov 01 '22 14:11

Bill Agee