You can run TestComplete tests as part of your Microsoft Build Engine (MSBuild) projects. TestComplete provides the MSBuildTC14Task.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 MSBuildTC14Task.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 -->
<!-- Declares the task type, ExecuteSolution, that will be used to run TestComplete projects (TC14 is a namespace). -->
<UsingTask TaskName="TC14.ExecuteSolution" AssemblyName= "MSBuildTC14Task, Version=18.104.22.168,
<!-- Target -->
<!-- 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
UsingTaskelement 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
UsingTaskstring 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
ExecuteSolutionelement to run the needed TestComplete project suite. The
ExecuteSolutionwith the assembly that will perform the task. The attributes of
ExecuteSolutionspecify run parameters:
Attribute Description SolutionFile [
in] The full path and name of the project suite file to run.
in] Indicates whether MSBuild run will fail if TestComplete task run fails.
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.
in] Indicates whether TestComplete ("true") or TestExecute ("false") will run tests.
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.