Wednesday 12 September 2018

Using Unified Agent for Executing Automated Tests Without Installing Visual Studio in Test Client–Azure DevOps/VSTS

As described in the post “Running UI Tests with Unified Agent” you can setup unified agent (same agent used for build/deployment in Azure DevOps/VSTS), in an application pool or in a deployment group to execute functional UI tests. The unified agent is really useful as it does not require to setup separate test agent using winRM based Deploy Test Agent task which is required if Run Functional Tests task is used for automated test execution.With unified agent you can use Visual Studio Test task, which is capable of running Selenium based UI tests as well, in addition to Coded UI tests. There was a dependency that you needed to have Visual Studio installed in the test client machine to get the Visual Studio Test task as it is packaged with Visual Studio. However, thanks to the NuGet package “Microsoft Test Platform”  you no longer need to install full Visual Studio in your test client machine to execute automated tests, with unified agent using Visual Studio Test task. Let’s look at how to use “Microsoft Test Platform”  and Visual Studio Test task in a test client using Azure DevOps Release Management.

As the first step you need to add “Visual Studio Test Platform Installer” task to your build or release pipeline, to acquire “Microsoft Test Platform”  and set it up in the test client machine. This task must appear before the Visual Studio Test task.image

For package feed you can use a custom feed or a network share as well, if internet connectivity is unavailable to the test client machine. The custom feed or network share must be added with the downloaded “Microsoft Test Platform”  NuGet package. If internet connectivity available to test client you can set up to use default Official NuGet feed. For “Microsoft Test Platform”  version you can set a specific version, latest stable or latest with pre-release.image

Next you have to add a Visual Studio Test task to the pipeline. You can specify a test assembly or assembly pattern or use test plan and suites, for test execution. The most important field to set is the Test Platform Version, which must be set to “Installed by Tools Installer” to use the “Microsoft Test Platform”.image

With the right test assembly or test plan settings in place you would be able to execute Functional UI tests with unified agents without having to install Visual Studio in the test client machine.image

Compared to Deploy Test Agent task which is taking longer time to setup, the “Visual Studio Test Platform Installer” task  runs in few seconds, letting you execute the mandatory functional UI tests even for each and every deployment to a Dev Integration environment, which can be configured to get deployed and tested for each code commit. True spirit of DevOps with Azure DevOps!!!image

No comments:

Popular Posts