Professional Visual Studio 2005 Team System (Programmer to Programmer)

To execute a web or load test from the command line, first launch a Visual Studio 2005 command prompt. From the Start menu, select Programs Microsoft Visual Studio 2005 Visual Studio Tools Visual Studio 2005 Command Prompt. This version of the command prompt sets environment variables that are useful for accessing Visual Studio utilities.

The MSTest.exe utility is found under the \Command7\IDE directory of your Visual Studio installation directory but will be available from any directory when using the Visual Studio command prompt.

Executing tests

From the directory that contains your tests, use the MSTest program to launch the test as follows:

MSTest /testcontainer:<Name=.<extension=

The target can be a web test, a load test, or an assembly that contains tests such as unit tests. For example, to execute a load test named LoadTest1, enter the following command:

MSTest /testcontainer:LoadTest1.loadtest

This will execute the specified test(s) and display details, such as pass/fail, which run configuration was used, and where the result were stored.

Executing test lists

You can also run tests that are grouped into a test list. See Chapter 13 for a full description of Test Manager and test lists. First, specify the /testmetadata:<filename= option to load the metadata file containing the test list definitions. Then, select the test list to execute with the /testlist:<listname= option.

Other test options

Remember that tests can have more than one run configuration. Specify a specific run configuration using the /runconfig:<filename= option.

By default, results are stored in an XML-based file called a TRX file. The default form is MSTest. MMDDYYYY.HHMMSS.trx. To store the run results in an alternate file, use the /resultsfile:<filename= option.

More options are available. To view them, run the following command:

MSTest /help

Категории