Running Automated Tests using TCM.exe
| This article is in a draft stage.|
This article describes the step by step instructions to running automated tests using TCM.exe from a command-line.
Running Automated Tests from a Command-line
1. Start Visual Studio Dev Environment Console:
- In Windows 7, select Start > All Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio Command Prompt (2010).
- If you do not have Visual Studio, contact email@example.com to request a license.
2. Type TCM.exe/help for a list of the options that can be passed in on the command line:
- TCM.exe comes with Visual Studio 2010 and should be located in
\Program Files\Microsoft Visual Studio 10.0\Common7\IDE.
3. List the Test Plans available in your project in the
TCM plans /list /collection:icstfs.ldschurch.org/upgradefromicstfs2008 /teamproject:<ProjectName>
- If no test plans are listed, go into Microsoft Test Manager and create one for your project.
Note: Rather than having to type the Collection Name and the Project Name for each command, you can add this information to the
Use the following format:
<configuration> <runtime> <!—runtime config stuff --> </runtime> <appSettings> <add key="TeamFoundationServer" value="http://icstfs.ldschurch.org/tfs/upgradefromicstfs2008"/> <add key="TeamProject" value="<ProjectName>"/> </appSettings> </configuration>
4. List the Test Suites available in your project (remember that Test Plans are suites, so they will show up in the results):
TCM suites /list /collection:icstfs.ldschurch.org/upgradefromicstfs2008 /teamprojects:<ProjectName>
- There will always be at least one test suite because of the Test Plan which is the root node in the hierarchy shown in Test Manager.
5. List the Configurations available in your project:
TCM configs /list /collection:icstfs.ldschurch.org/upgradefromicstfs2008 /teamproject:<ProjectName>
- If there are no Configurations listed, you can go into Test Manager and create a Configuration. Click the Organize tab in the Testing Center and click on Test Configuration Manager.
6. List the Test Environments available in your project:
TCM testenvironments /list /collection:icstfs.ldschurch.org/upgradefromicstfs2008 /teamproject:<ProjectName>
- If there are no test environments listed, then go into MTM and create on under the Lab Center.
7. Create and execute a Test Run containing a Suite of Automated Tests:
TCM run /create /title:TestRun1 /planid:<PlanID> /suiteid:<SuiteID> /configid:<ConfigID> /testenvironment:<EnvironmentName>
- No output will be displayed except for the following line of text:
- Run created with ID: <RunID>
8. List all Test Runs that have been run for your project:
TCM run /list /collection:icstfs.ldschurch.org/upgradefromicstfs2008 /teamproject:<ProjectName>
9. The Test Run will show up in MTM, if you select the Test tab in the Testing Center and select Analyze Test Runs. When the Test Run is opened, it shows the results of the tests in the Test Run. Each test can be double clicked on to show more details.