LDSTechForumProjects

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 tfs@ldschurch.org 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/help
  • TCM.exe comes with Visual Studio 2010 and should be located in \Program Files\Microsoft Visual Studio 10.0\Common7\IDE.

VisualStudioCommandPrompt2010.png

3. List the Test Plans available in your project in the icstfs.ldschurch.org/upgradefrom2008 Collection:

  • 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 tcm.exe.config file.

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>

CreatingTestPlans.png

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.

ListingTestSuites.png

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.

CreatingConfigurations.png

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.

CreatingTestEnvironments.png

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>

CreatingATestRun.png

8. List all Test Runs that have been run for your project:

  • TCM run /list /collection:icstfs.ldschurch.org/upgradefromicstfs2008 /teamproject:<ProjectName>

ListingAllTestRuns.png

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.

Additional Resources

This page was last modified on 7 December 2012, at 16:37.

Note: Content found in this wiki may not always reflect official Church information. See Terms of Use.