Assigning Roles to a Test Controller and Test Agent for Automated Testing in Visual Studio
This topic applies to:
|Visual Studio Test Professional||Visual Studio Enterprise||Visual Studio Professional||Visual Studio Express|
This walkthrough demonstrates how to create and configure a test setting that uses a test controller and test agent to distribute testing across several machines using Visual Studio. In addition, this walkthrough demonstrates how to add diagnostic and data adapters to the test setting.
In this walkthrough, you will complete the following tasks:
Create a test setting.
Assign roles to a test controller and test agents.
Assign a diagnostic and data adapter to your test setting.
Create unit tests or coded UI tests to run with the test setting. For information about how to create unit tests or coded UI tests, see Create your tests.
You must have a test controller and test agents installed. For information about how to install a test controller and test agents, see Install and configure test agents.
In Solution Explorer, right-click Solution Items, point to Add, and then choose New Item.
The Add New Item dialog box appears.
In the Installed Templates pane, choose Test Settings.
In the Name box, type TestSettingDistributedTestWalkthrough.
The new test TestSettingDistributedTestWalkthrough.testsettings file appears in Solution Explorer, under the Solution Items folder.
The Test Settings dialog box is displayed. The General page is selected.
You can now edit and save test settings values.
Each test settings that you create is listed as a choice for the Select Active Test Settings and Edit Test Settings options on the Test menu.
Under Name, type the name for the test settings.
Under Description, type Distributed test settings.
Leave Default naming scheme selected.
The Roles page is displayed.
To run your test remotely, use the Test execution method drop-down list and select Remote execution.
In the Controller drop-down list, type the computer name of your test controller.
If this is the first time that you are adding a controller, there are no controllers listed in the drop-down list. The list is populated by previous controllers that you have specified in other test settings.
Under Roles, choose Add.
In the highlighted row under the Name column, type Distributed test.
Choose Data and Diagnostics.
The Data and Diagnostics page is displayed.
Under Role, verify that the Distributed test role is selected.
Under Data and Diagnostic for select role, select the IntelliTrace and System Information adapters.
For information about these adapters and other adapters that you can use in a test setting, see Specifying Test Settings for Visual Studio Tests.
(Optional) If your machine is running under a 64-bit version of Microsoft Windows, and you compiled your test using the Any CPU configuration, use the Run test in 32 bit or 64 bit process drop-down list and select Run tests in 64-bit process on 64-bit machine.
For maximum flexibility, you should compile your test projects with the Any CPU configuration. Then you can run on both 32- and 64-bit agents. There is no advantage to compiling test projects with the 64-bit configuration.
To save the new test settings, choose Apply.
On the Test menu, select Select Active Test Settings and then choose TestSettingDistributedTestWalkthrough.testsettings.
Run your test as usual.
When the test controller processes unit tests and coded UI tests, the test controller divides the tests into groups of 100 and sends them to a test agent machine. For example, if you have 250 unit tests and three test agents, the first 100 unit tests will be sent to agent1, the next 100 unit tests will be sent to agent2 and the remaining 50 unit tests will be sent to agent3.
For more information about how to create test settings to use in Visual Studio, see Specifying Test Settings for Visual Studio Tests.