Running TestComplete Tests From MSBuild Projects

Applies to TestComplete 15.46, last modified on December 01, 2022

You can run TestComplete tests as part of your Microsoft Build Engine (MSBuild) projects. TestComplete provides the MSBuildTC15Task.dll assembly describing the tasks that run TestComplete tests.


Your computer must have Microsoft .NET Framework 2.0–3.5 installed. TestComplete supports MSBuild included in these versions.

TestComplete installation program will install and register the MSBuildTC15Task.dll assembly in the global assembly cache (GAC) automatically.


Below is a typical example of running a TestComplete project suite from an MSBuild project:


<!-- File: MSBUILD.proj -->

<!-- Root element of the MSBuild project -->
<Project DefaultTargets="Build"
  <!-- Declares the task type, ExecuteSolution, that will be used to run TestComplete projects (TC15 is a namespace). --> 
  <UsingTask TaskName="TC15.ExecuteSolution" AssemblyName= "MSBuildTC15Task, Version=,
Culture=neutral, PublicKeyToken=e33f56e68d0f845e"/>
  <!-- Target -->
  <Target Name="Build">
  <!-- Executes the task. Note that the tag name, ExecuteSolution, coincides with the registered task name.   -->

The example is simple, but it demonstrates two key points of executing a TestComplete project suite from an MSBuild project:

  • Registration. To run a TestComplete project suite from MSBuild projects, you should register a special task type. The registration is done via the UsingTask element whose attributes specify the task name and the name of the assembly that will perform the task. You should always register the task type before using it in an MSBuild project. The registration string should always be the same as it is specified in the sample. You can copy the UsingTask string and paste it to your MSBuild project file. Do not modify this string in your MSBuild project file.
  • Execution. Upon registering the task type, you can use the ExecuteSolution element to run the needed TestComplete project suite. The UsingTask element associates ExecuteSolution with the assembly that will perform the task. The attributes of ExecuteSolution specify run parameters:
    Attribute Description
    SolutionFile [in] The full path and name of the project suite file to run.
    StopIfFail [in] Indicates whether MSBuild run will fail if TestComplete task run fails.
    AdditionalOptions [in] A string of command-line arguments passed to TestComplete along with the project suite file name. For more information on supported command-line arguments, see TestComplete Command Line.
    GUIInteractive [in] Indicates whether TestComplete ("true") or TestExecute ("false") will run tests.
    LogFile [in] The full path and name of the .MHT file to which TestComplete will export test results. The results are always exported to files of the Multipart HyperText (MHT) format. You can view these files in Microsoft Internet Explorer.

See Also

Integration With Microsoft Visual Studio and Azure DevOps

Highlight search results