Forum Discussion

mgy333's avatar
mgy333
Contributor
10 years ago

Running TestExecute on a headless VM

Hi all,



I am trying to run TestComplete scripts using TestExecute on a headless VM.



The VM is created automatically in clean state, installs TestExecute and other software, then launches the script.



I got this error:



Possible reason:The Switch User command was used.    The test is run on a computer that is controlled via Remote Desktop, and the Remote Desktop Connection was closed.Learn more about the problem and possible solutionsTested object:Sys.Process("rundll32").Window("#32770", "Internet Properties", 1).Window("SysTabControl32", "", 1)





Obviously there is a issue because the test VM is headless.



Is there a way to get around this issue?  Is there a automatic way to start a GUI session, so TestExecute can properly execute the test?



Thanks,

Motoo

3 Replies

  • simon_glet's avatar
    simon_glet
    Regular Contributor
    Hi Motoo,



    We do most of our tests on VMs but, on every one of them, a user must be logged in and have an open session (not locket) in order for TestExecute to perform.



    Microsoft Remote Desktop might not the way to go because as soon as you close the RDC client, the session stays locked. You might want to look at other remote connexion options like VNC, DameWare Mini Remote Control or TeamViewer.



    Sincerely
  • Hi Simon,



    The problem in our case is that everything is automated, so there is no chance to login to a headless machine, whether it is from RDP or VNC.  I am looking for a way to maybe open a virtual gui session automatically, maybe?  I am thinking about trying to call VNC in loopback, but that's not very elegant solution even if it works.



    There is a way to use RDP for automation.  It doesn't work in my case, but maybe you'll find this useful.



    Creat a batch file with the following lines:



    tscon.esxe 0 /dest:console

    tscon.esxe 1 /dest:console

    tscon.esxe 2 /dest:console

    tscon.esxe 3 /dest:console



    When closing RDP connection from the host, don't just close it, but to call the batch file (you can keep the shortcut close by).  The gui automated test keeps running even when you close RDP window.

  • simon_glet's avatar
    simon_glet
    Regular Contributor
    Hi Motoo,



    Thanks for the RDP automation input.



    We have a test that logs in users with different profiles and to do that we used the TestComplete distributed testing feature.



    It's migh seem like an overkill solution but it works just fine. The only drawback is that you will need a machine just to run the Network Suite.



    Sincerely