2

We are attempting to do our testing remotely, so we set up some Virtual Machines to run our GUI tests and to free up our local machines. What we were hoping for was to have the tests run just like they would on a physical machine, however they seem to require an active Remote Desktop Connection up in order to run properly. These tests are written using LeanFT and it is a windows app so this is not mobile GUI testing.

Is there a certain way to configure this VM to set it up properly for automated GUI testing that does not require an active Remote Desktop Connection? It seems as if its sharing the controls on our physical machine..

Or am I completely wrong here.. Is a Remote Machine different than a Virtual Machine? Thanks!

Adelin
  • 7,809
  • 5
  • 37
  • 65
Tree55Topz
  • 1,102
  • 4
  • 20
  • 51
  • "Remote Machine" just means a computer that is not your current OS. "Virtual Machine" is a computer that is running inside another OS. You can Remote Desktop into a Virtual Machine on your same box. – gunr2171 Nov 21 '17 at 19:46
  • Could it be that your remote desktop is configured to automatically log out at the end of the session? If it logs out, then any applications (including your tests) get terminated, only services remain running. There should be a way to configure remote desktop to not do anything when disconnecting, or at most lock the machine upon disconnection, instead of logging out. – Mike Nakis Nov 21 '17 at 19:49
  • @MikeNakis, This is true, however - even when the window is minimized we run into issues because the elements can not be found. The VM literally needs to be displayed in order in to work – Tree55Topz Nov 21 '17 at 19:51

2 Answers2

3

It's possible to run a GUI test without an active Remote Desktop Connection

I achieved this with leanft through the following 2 steps:

  1. Configure how you execute your tests

Whether you're running via a Jenkins slave or through another kind of "listener" (maybe ssh, or bamboo, etc.), you need to configure this listener to start after a specific user is logged on.

In my case I was running through the Jenkins slave, so I've configured the startup of the slave to launch as soon the user logged in.

  1. Tell windows to login the user when the computer starts. You can achieve that via the following registry:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    "DefaultDomainName"="DOMAIN"
    "DefaultUserName"="USERNAME"
    "AutoAdminLogon"="1"
    "DefaultPassword"="PASSWORD"
    
Cerbrus
  • 70,800
  • 18
  • 132
  • 147
Adelin
  • 7,809
  • 5
  • 37
  • 65
0

The core requirement is that you need to have an active session (regardless of whether you are using Jenkins, TeamCity, Grid or other tools to launch the tests).

For your virtual machine, you will need to have access to the console. For VMWare vSphere, there is a native client or website. For VMWare Workstation or VirtualBox, these automatically display.

Using the console access, log into the system and set it up to never log out or sleep or hibernate. This is a variety of OS settings that you can look up.

Essentially, these boxes need to always be logged in. With this setup, you need to be sure access to these systems is controlled so that you don't have random people logging in / or logging out.

not-bob
  • 815
  • 1
  • 8
  • 23