Run Coded UI Tests on a VM
I was recently helping a team start testing their application using SpecFlow and Coded UI. They were also using TeamCity as a continuous integration server. Setting up SpecFlow to run Coded UI tests is well documented on the Specflow Wiki. Running SpecFlow tests in Teamcity has been well covered in this blog post by Hamish Graham. The challenge that we encountered was in running UI Tests on locked computers.
It is not possible within our organization to disable screensavers, which prevent UI tests from running. To get around this, we set up several VMs using VMware Player. on physical servers and installed TeamCity build agent on them. The VMs were configured without screen savers. Port forwarding was set up to allow connection to the build agent, in addition to several ports for the applications to communicate with their servers.
The TeamCity build agent can be set up to run as an interactive process (launch it from the command line rather than as a service), or the Microsoft Test Controller and Test Agent can be used to allow distribution of the test run across several VMs. Make sure to run the Test Agent as an interactive process, if you’re going to run the tests in this way. You’ll need additional port forwarding set up for the test controller and agents if you choose to use the Microsoft test controller.
Each VM must be open on it’s machine to keep the desktop session alive. If the VM is open, the physical machine can be safely locked. Remoting into the VM Directly will cause the desktop session to be closed on log out, so make sure that any users needing access to the VM running the tests are able to connect to the physical machine.
Hello, Nice Post .But can you share your view for this problem .
As a starter i dont know how to coded ui test in VMware ?I have to automate customization EPICOR ERP. How to configure Visual studio test environment in VMware for coded ui?
I’m not sure specifically which problem you’re trying to solve. The VMware virtual machine will be running a Test Agent. Microsoft provides great documentation for setting up Test Agents and controllers for your specific version of Visual Studio.