‘Run Functional Tests’ (RFT) task is used for running functional tests using remote machines or to run tests in a distributed manner using multiple machines. With TFS 2017 Update 2 and VSTS, You can use “Run Functional Tests” task to run tests using Visual Studio Test Agent 2017.
The RFT task needs a companion ‘Deploy Test Agent’ task that deploys and configures test agents against your VSTS account or the TFS server. Using the Deploy Test Agent version 2 task, you can now choose which version of Test Agents you want to deploy.
For machines which are connected to the internet, the process is pretty straightforward.
The required test agent will be downloaded and installed automatically if it’s not present on the machine.
For machines that are not connected to the internet, the task supports installing test agents from a shared UNC path. For this, you need to make the test agent installer available on a network share.
If you are installing Test Agent 2015, use the following steps:
- Download Test Agent 2015 from https://go.microsoft.com/fwlink/?LinkId=827840
- Copy the test agent to a machine which is accessible by build agent and test agent machines
- Share the test agent folder using Windows file sharing
- Use the shared path location in “Visual Studio Test Agent Deployment” task as shown below
With the Visual Studio 2017 release, the packaging and installation experience has changed. So you need to first create an offline installer using the bootstrapper. The installer also checks for certificates to verify package authenticity, so some extra prep is required before an offline installer can be used by the ‘Visual Studio Test Agent Deployment’ task.
Here are the required steps:
- Download the bootstrapper vs_testagent.exe from: https://aka.ms/vs/15/release/vs_TestAgent.exe
- Run the following command to create an offline cache (the following example assumes ENU language)
vs_testagent.exe –layout C:\TA2017Setup –lang en-US
This downloads the Test agent packages to C:\TA2017Setup\ folder
3. Now “Archive/Zip” all the contents of the folder and name it as “TestAgent.zip”. Please make sure you retain the directory information while zipping.
4. Share the folder which contains “TestAgent.zip” using Windows file sharing.
5. Use the shared path location in “Visual Studio Test Agent Deployment”
- For Test agent 2017, make sure the archive retains the folder structure as shown and name it “TestAgent.zip”
- Offline installation is supported only for “HTTP/local” machines. If you are using Azure machines, the agent will be downloaded from internet and installed automatically. For creating Azure machines, we recommend creating “VM image with Test Agent preinstalled”. If Test Agent is preinstalled, the ‘Deploy Test Agent’ step skips the installation portion and simply configures the agent, and thus runs faster.
- It is also recommended that you install the latest Windows Management Framework on test agent machines
- A prerequisites checklist is available at https://github.com/Microsoft/vsts-tasks/tree/master/Tasks/DeployVisualStudioTestAgent