1. Configuring Visual Studio Test Projects to Run AQTime Projects

Applies to AQTime 8.81, last modified on January 18, 2022

To run AQTime projects as part of your team build, create a Visual Studio test project containing AQTime Test items.

In our explanations, we assume that the test project is created and configured on one computer, but will be run on another computer (a build server). For information on requirements to these computers, see Running AQTime Projects as Part of Build And Release Pipeline - Requirements.

Requirements

The computer, where you create and configure Visual Studio test projects, must have the following software installed:

  • One of the following Visual Studio versions:

    • Microsoft Visual Studio 2015 (Professional or Enterprise).

    • Microsoft Visual Studio 2010 - 2013 (Professional, Premium or Ultimate).

    • Microsoft Visual Studio Team System 2008 (Team Suite or Test Edition).

    • Microsoft Visual Studio 2005 (Team Suite or Team Edition for Testers).

  • AQTime with the appropriate Visual Studio integration.

Before You Start

When you build your Visual Studio projects on a build server, AQTime Test items (.aqtimetest) will be copied to the build output folder. However, the AQTime project files (.aqt) will not be copied to the output folder because they do not belong to the Visual Studio test project.

To run an AQTime project as part of a team build:

  1. Configure your team build to copy AQTime projects to the needed location on the build server.

  2. Make sure that the AQTime Test items can access the AQTime projects, that is, the path that the items specify is valid.

For this, we will create custom build steps that will copy the AQTime project file to a proper folder. For instructions on how to create custom build steps, see below.

1. Preparing AQTime Projects for Integration

Before creating a Visual Studio test project, prepare your AQTime project for integration:

  • Specify the modules to be profiled, areas, triggers, actions, and so on and make sure that your AQTime project functions properly.

  • Make sure that the build has access to the project. That is, you can either share the folder that contains your AQTime project for network access, or store the project on the server.

  • Make sure that the build computer can access all the required libraries and modules.

Once your AQTime project is ready, you can integrate it into the Visual Studio test project.

2. Adding AQTime Projects to Visual Studio Test Projects

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

  2. In Solution Explorer, add a new folder to your Visual Studio test project. This is the folder where your AQTime Test items will reside:

    AQTime integration with Visual Studio: Create a folder to store AQTime Test items
  3. Right-click the created folder and select Open Folder in Windows Explorer from the context menu. This will open the created folder in Windows Explorer.

    Place your AQTime project in the folder:

    AQTime integration with Visual Studio: Place your AQTime project to the created folder
  4. Add your AQTime project to source control.

  5. In Visual Studio Solution Explorer, add a new AQTime Test item to the created folder:

    AQTime integration with Visual Studio: Add an AQTime Test item to your Visual Studio test project
  6. Configure the item to run the needed AQTime project:

    AQTime integration with Visual Studio: Configure the added AQTime Test item

    Click the image to enlarge it.

    To use TestComplete tests to simulate user actions over your application during the profiling, specify the TestComplete project.

3. Creating a Test List (for Visual Studio 2005 – 2010)

If you use Visual Studio 2005 – 2001, create a test list containing your AQTime test (if you use a later version of Visual Studio, skip this step):

  1. In Visual Studio 2010 and 2008, switch to the Test List Editor panel. To display the Test List Editor panel, select Test > Windows > Test List Editor from the main menu.

    In Visual Studio 2005, switch to the Test Manager panel. To display the Test Manager panel, select Test > Windows > Test Manager from the main menu.

  2. In the left section of the corresponding panel, right-click the List of Tests node and choose New Test List from the context menu. This will call the Create New Test List dialog:

    AQTime integration with Visual Studio: Create New Test List Dialog

    In the dialog, specify the test list name, description and location and click OK. Visual Studio will display the newly created test list in the Test Manager panel (or in the Test List Editor panel).

  3. Select the All Loaded Tests node in the Test List Editor panel (or in Test Manager). Visual Studio will display a list of all available tests on the right.

  4. Drag the AQTime test from the right part of the Test List Editor panel (or Test Manager) to the test tree and drop the test on the created test list.

  5. Check the AQTime test in the Test List Editor panel (or in Test Manager) to enable it.

  6. Save the changes made to the test project by selecting File > Save All from Visual Studio main menu.

4. Creating Custom Build Steps

Create custom builds steps that will copy your AQTime project to the test project’s output folder:

  1. In Visual Studio Solution Explorer, select your test project and choose Properties from the Project menu.

  2. In the ensuing Project Designer panel, switch to the Build Events tabbed page.

  3. In the Pre-build event command line box, specify commands that will clear the AQTimeFolder_Name folder in the project’s output folder:

    rd /S /Q "$(TargetDir)AQTimeFolder_Name"

    And in the Post-build event command line box, specify commands that will copy your AQTime project to the Visual Studio test project’s output folder:

    md "$(TargetDir)AQTimeFolder_Name"
    xcopy "$(ProjectDir)AQTimeFolder_Name" "$(TargetDir)AQTimeFolder_Name" /Y /E

    Where AQTimeFolder_Name is the name of the folder that contains your AQTime Test file (.aqtimetest) and the corresponding AQTime project (see above).

5. Adding Test Projects to Source Control System

Team Foundation tools work only with files stored in a source control. Add your Visual Studio test project to a source control:

If You Use Team Foundation Version Control
  1. Right-click your solution in the Solution Explorer and select Add Solution to Source Control from the context menu.

  2. (For Visual Studio 2013 and later) In the subsequent Choose Source Control dialog, select the Team Foundation Version control and click OK.

  3. In the subsequent Add Solution to Source Control dialog, specify the source control project and folder where the test project will be added.

    AQTime integration with Visual Studio: Add your Visual Studio test project to source control
  4. Click OK. Visual Studio will add the project files to the Team Foundation source control.

  5. Right-click the solution node in the Solution Explorer and choose Check In from the context menu or click Check In in the Team Explorer panel.

  6. In the subsequent Check In dialog, click the Check In button. Visual Studio will check in the solution files to the source control system.

If You Use Git (For Visual Studio 2013 and later)
  1. Right-click your solution in Solution Explorer and select Add Solution to Source Control from the context menu.

  2. In the subsequent Choose Source Control dialog, select Git and click OK.

  3. In Team Explorer, click Commit to commit your solution files to the Git repository.

Next

See Also

Running AQTime Projects as Part of Build And Release Pipeline
Adding AQTime Projects to Visual Studio Test Projects

Highlight search results