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

3

5

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 ?

Entire answered 14/9, 2011 at 16:19 Comment(0)
K
6

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.

Kwakiutl answered 15/9, 2011 at 7:45 Comment(1)
Those are great tips and it looks like it'll solve my problems entirely. Thanks!Entire
I
1

You may consider using the Network Suites functionality of TestComplete: http://smartbear.com/support/viewarticle/16849/

It can open Remote Desktop connections on its own, control tests on remote PCs, and pull the logs back to the "master" project. This feature is designed to be used for distributed tests, and looks like it's just what you need.

As for opening RDP to a head-less VM, it should not be a problem - it's up to Windows to "think" about this. You just open RDP and it works even if there is no monitor attached to the remote PC/VM.

I hope this helps, Alex

Isidraisidro answered 14/9, 2011 at 18:58 Comment(1)
This helps though Bill's answer will be easier / cheaper for my needs. Thanks.Entire
A
0

You can always use VNC with checking the option "Do nothing" when disconnecting viewer. This way you'll trick windows to generate the image.

Avan answered 29/10, 2012 at 16:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.