|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
How to: Create a Generic Test
A generic test wraps an existing test, program, or third-party tool. After that program has been wrapped as a generic test, Team System testing tools treats it like any other test type: You can manage and run it and obtain results using the same Team Edition for Testers windows and tools.
The following procedure presumes that you have an existing test, program, or third-party tool in the form of executable file to wrap as a generic test. You must be able to run this executable file from the command line, and it must return a value of Pass or Fail.
For more information, see.
To create a generic test
In Solution Explorer, right-click a test project, point to Add, and then click Generic Test.
A template for a generic test is added to your test project and opened in the main editing window. The new generic test is given a default name, such as GenericTest1.generic, and is displayed in Solution Explorer within the test project.
Under Specify an existing program (a test, test harness, or test adapter) to wrap as a generic test, indicate the path and file name of the test, program, or third-party tool to wrap into a generic test.
(Optional) Under Command line arguments to pass to the generic test, type one or more arguments to pass. Separate multiple arguments with spaces.
(Optional) Under Additional files to deploy with this generic test, specify any files that the test must have to run correctly.
Before the test runs, the files that you specify in this step are copied to a deployment directory that is created by Visual Studio. For more information, see.
(Optional) Under Working Directory, specify a directory that the executable file is to use as a working directory as it runs.
(Optional) Specify the name of a results file.
Save the generic test.
The test is now ready to run; it will return a result of 0 or another number. The test engine interprets 0 as Passed and any other number as Failed.
Not only can a generic test call any executable program on your computer, it uses your credentials as it does so. For this reason, make sure you trust the author of the program and know what the program will do.