We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

Running Tests in Lab Environments

You can run tests in a lab environment after you deploy your application to your environment or after your application is automatically deployed as part of a build-deploy-test workflow. You can run these tests with the user interface in Microsoft Test Manager or from the command line using Tcm. Build-deploy-test workflows use Tcm to run tests. If you are using a build-deploy-test workflow to deploy your application to your lab environment, you can also run automated tests as part of your workflow. See, Setting Up Automated Build-Deploy-Test Workflows.

For information about configuring lab environments, see Using a Lab Environment for Your Application Lifecycle.


  • Visual Studio Ultimate, Visual Studio Premium, Visual Studio Test Professional

Here’s a comparison of the testing features for each type of lab environment:

Testing Environments


All lab environments

  • Run manual and automated tests.

  • Run tests on multiple machines with different roles such as a desktop client, web server, and database server.

  • Build, deploy, and run automated tests on your application with a build-deploy-test workflow.

Standard Environments

  • In addition to virtual machines, you can run tests on multiple physical machines in your environment. You can't run tests on physical machines in SCVMM environments.

  • In addition to Hyper-V based virtual machines, you can run tests on non-Hyper-V based virtual machines such as VMware.

SCVMM Environments

  • Save the state of your environment during the build and deploy process by taking snapshots, then attach the snapshot to a bug so it can be easily and accurately reproduced.

  • Automatically restore your environment to a known state at the beginning of each test run.

  • Run tests on multiple copies of an environment at the same time through network-isolation.

Use the following topics to help you run your tests in lab environments:


Associated Topics

Running automated tests in lab environments after deploying your application: You can run automated tests in your lab environments using Microsoft Test Manager or from the command line with tcm.exe after you deploy your application.

Running automated tests as part of a build, deploy, and test workflow: You can create a build-deploy-test workflow that builds your application, deploys it to a lab environment, then runs automated tests on it using a build definition.

Running manual tests and creating reproducible bugs using lab environments: You can run manual tests in a lab environment to record the results of each test and the test data from your lab environment before and after your test runs. If you are using an SCVMM environment, you can schedule a snapshot of your environment before and after your test runs. This allows you to submit a bug that includes a link to the snapshot that a developer can use to easily re-create the environment at the time the bug occurred.