Add TestComplete Tests to Visual Studio Test Projects

Applies to TestComplete 14.50, last modified on April 22, 2021

TestComplete integration with Visual Studio adds a new item type to Visual Studio Test projects, TestComplete Test. Use this item to add TestComplete projects and project suites to Visual Studio test projects and run them in the same way you run native Visual Studio tests.

Requirements

You must have the following software installed on your computer:

  • One of the following Visual Studio versions:

    • Microsoft Visual Studio 2015–2019 (Community, Enterprise or Professional edition).

    • Microsoft Visual Studio 2013 (Community, Ultimate, Premium, or Professional edition).

    • Microsoft Visual Studio 2010–2012 (Ultimate, Premium, or Professional edition).

    Integration with Visual Studio 2010–2013 has become obsolete. It will be removed in one of the future releases.

  • TestComplete 14.

  • TestComplete 14 Visual Studio Integration Package.

    The Integration Package installer is shipped along with TestComplete. You can find it in the TestComplete folder after installing the product:

    <TestComplete 14>\VS Integration\VSIntegration.exe

    Run this installer after installing TestComplete on your computer. In the installation wizard, select the Visual Studio Integration feature appropriate for your Visual Studio version.

Before You Start

  • TestComplete 14 Test items store a relative path to TestComplete projects to be run.

    If you run TestComplete tests remotely (for example, on a build computer as part of a pipeline), the path to the TestComplete project that the TestComplete Test item stores may become invalid. To avoid this issue, make sure that the path that the item stores corresponds to the actual location of the TestComplete project.

    You can find detailed instructions on how to do it in appropriate sections.

  • You cannot add TestComplete tests to Visual C++ unmanaged (native) test projects.

    As a workaround, we suggest that you add a test project of any other type (for example, a Visual C++ Managed Test project) to your solution in Visual Studio and run TestComplete tests from that project.

1. Add a TestComplete Test Item to Visual Studio Test Project

  1. In Microsoft Visual Studio, open your Visual Studio test project or create a new one:

    TestComplete integration with Visual Studio: Create Visual Studio test project

    Note: You cannot add TestComplete tests to Visual C++ unmanaged (native) test projects. As a workaround, we suggest that you use a test project of any other type (for example, a Visual C++ Managed Test project) to keep TestComplete tests.

  2. (In Visual Studio 2012–2019, for Visual Basic Test, Visual C# Test and Visual C++ Managed Test projects) Right-click your project in the Solution Explorer, and then click Add > TestComplete Test:

    TestComplete integration with Visual Studio: Adding TestComplete Test item via context menu

    – or –

    Right-click your project in the Solution Explorer, and then click Add > New Item (in Visual Studio 2012–2019) or Add > New Test (in Visual Studio 2010). Visual Studio will display a dialog with available item types. In the dialog, select the TestComplete Test type:

    TestComplete integration with Visual Studio: Adding TestComplete Test item via Add New Test Dialog

    Specify the needed test name and click OK.

Visual Studio will create a new test of the TestComplete Test type and add it to the project:

TestComplete integration with Visual Studio: TestComplete Test item in Solution Explorer

2. Configure TestComplete Test Item to Run TestComplete Tests

  1. Double-click the TestComplete Test node in the Solution Explorer. Visual Studio will open it in the TestComplete Test editor.

  2. In the TestComplete project box, click the ellipsis button and browse for the TestComplete project or project suite file that contains the tests you want to run.

  3. The editor will show a tree-like structure of available test items:

    TestComplete integration with Visual Studio: Configuring TestComplete Test item

    By default, the structure and selection of items coincide with the structure and selection stored in your TestComplete project or project suite.

  4. To run test items selected in the project suite, click Selected in project suite in the Run test items section.

    To select needed tests items manually, click Selected below in the Run test items section and select the needed items in the test items tree. To select and unselect items, you can also use buttons on the toolbar at the top of the editor.

  5. In the Preferred test runner section, choose the application (TestComplete or TestExecute) that you want to use to run tests. If only one of the applications is installed on the computer where the test project is run, the corresponding test runner is selected automatically.

  6. To modify the TestComplete project or project suite, click Edit Project.

  7. Save the changes.

3. Run TestComplete Test Item

The following ways to run TestComplete tests are deprecated. We do not recommend using them. To run TestComplete tests as part of your build or release pipeline, we recommend that you use the new TestComplete integration with Azure DevOps. See Integration With Azure DevOps and Team Foundation Server.

See Also

(Obsolete) Integration With Azure DevOps and Team Foundation Server via TCTest Item

Highlight search results