Microsoft Visual Studio includes tools and technologies for all members of software development teams: project architects, developers, managers and, of course, testers. TestComplete can integrate with these tools giving your Quality Assurance team the ability to:
- Run unit tests created with Visual Studio as part of your TestComplete projects:
Run TestComplete tests directly from your MSBuild projects:
<!– File: MSBUILD.proj –>
<Project DefaultTargets=”Build”
xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″>
<!– Declares the task type that will run TestComplete projects–>
<UsingTask TaskName=”TC14.ExecuteSolution” AssemblyName= “MSBuildTC14Task, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=e33f56e68d0f845e”/>
…
</Project> Learn more skills from DevOps Training
Include your TestComplete tests into your Visual Studio test projects and run them locally the same way you run Visual Studio native tests (like unit tests):
- Integrate TestComplete tests into your team projects managed with Azure DevOps or Team Foundation Server.
In other words, you can mix tests created in both products and make your testing flexible and powerful.
In This Section
Running Visual Studio Unit Tests From TestComplete
Describes how you can run Visual Studio unit tests from TestComplete projects.
Running TestComplete Tests From MSBuild Projects
Explains how to integrate TestComplete projects into MSBuild projects.
Run TestComplete Tests From Visual Studio
Describes how to run TestComplete tests from Visual Studio.
Install Integration Package
Describes how to install the integration package that is shipped with TestComplete and that allows running TestComplete tests from Visual Studio. Get more skills DevOps Online Course
Running Visual Studio Unit Tests From TestComplete
You can include unit tests created with MSTest in your TestComplete projects and run them directly in TestComplete. This way you can integrate Visual Studio unit tests into the collection of tests that you use to test your application(s).
To run MSTest unit tests in TestComplete:
- Set the path to the MSTest command-line executable (MSTest.exe) in the Tools > Options > Unit Testing dialog.
- Add a Selenium or Unit Testing item to your project:
- Right-click your project’s node in the Project Explorer and choose Add | New Item from the context menu.
- TestComplete will open the Create Project Item dialog.

- Select Selenium or Unit Testing in the list of available project items. If needed, enter the item name and the location of the item file. Click OK.
TestComplete will add a new project item to your project.
- Add a unit test of the MSTest type to the Selenium or Unit Testing collection:
- Right-click the Selenium or Unit Testing collection in Project Explorer, then click Add | New Item.
- In the Create Project Item dialog, select MSTest in the list of available test types.
-
- Enter the test name.
- If needed, enter the location of the file that will store the test settings.
- Enter the path to the assembly storing the needed MSTest tests. You can also click the ellipsis button and browse for the needed file.
- Click OK.
- TestComplete will add a new MSTest item to your project.
You can edit properties of the added MSTest item in the MSTest Unit Test editor.
After adding the MSTest item to your project and specifying its parameters, you can use this item in your TestComplete projects: run it as a test item, run it from your scripts, and so on.
Running TestComplete Tests From MSBuild Projects
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.
Requirements
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.
Example
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”
xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″>
<!– Declares the task type, ExecuteSolution, that will be used to run TestComplete projects (TC14 is a namespace). –>
<UsingTask TaskName=”TC14.ExecuteSolution” AssemblyName= “MSBuildTC14Task, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=e33f56e68d0f845e”/>
<!– Target –>
<Target Name=”Build”>
<!– Executes the task. Note that the tag name, ExecuteSolution, coincides with the registered task name. –>
<ExecuteSolution
SolutionFile=”C:\MyProjects\MyProjectSuite.pjs”
StopIfFail=”true”
AdditionalOptions=”/project:MyProject”
GUIInteractive=”true”
LogFile=”C:\MyProjects\MyResults.mht”
/>
</Target>
</Project>
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.
To get in-depth knowledge, enroll for a live free demo on DevOps Online Training