Load Testing in Visual Studio Team Services (VSTS) a.k.a. Azure DevOps Test Hub

Posted by: Gouri Sohoni , on 9/21/2018, in Category VSTS & TFS
Views: 2369
Abstract: In this load testing tutorial, I will discuss what is Load Testing and how VSTS (Azure DevOps) Test hub provides different types of Load Testing.

Testing is essential for monitoring the health of a software application or product. It is very important to ensure that the application will not result in any un-expected behavior or failure.

Testing helps in maintaining the Quality of the product or application and makes the application defect free. It also finds any gaps or missing requirements in the application.

The First type of testing normally done is Functional testing.

Functional testing ensures that the application is working as expected. Many of the applications under development are web applications or web services. Most of these application now-a-days run for a long duration, for many concurrent users, over many networks and across many browsers.

While testing the app, we need to find out the application’s performance by taking it to a real-world scenario where there are any number of users, networks, as well as different browsers. This type of testing is called Load Testing.

Load testing helps us give an analysis of performance counters on servers when loaded to the point of actual load and beyond.

Load Testing will help us identify if there is any performance degradation when high number of users execute the same application at the same time.

It helps in finding behaviour when users use different browsers and networks. It tries to increase the load in terms of users, browsers, networks, duration and gives us analysis of how an application is behaving. It will let us add think time (time required by any user to enter data or click on a link) and find the performance.

In a previous article, I discussed Performance Testing with Azure Portal. In this article, I will discuss Load Testing and its features in Visual Studio Team Services (VSTS).

Load Testing and its features in Visual Studio Team Services (VSTS)

Load Test does support testing of URL based REST APIs. But an important feature which Load Testing with Test hub does not provide is to have dynamic information. In this situation we need to run the tests using Visual Studio.

Pre-requisites:

a. Visual Studio Team Services (VSTS) account

b. A Web Performance Test created using Visual Studio 2017 Enterprise

VSTS Account

If you do not have VSTS account go to https://www.visualstudio.com, click on Get Started for Free for Visual Studio Team Services and follow.

Once a VSTS account is created, we can add a Team Project in it. The Load Test tab can be found as follows

<Team Project Name> – Test

load-test-tab-in-vsts-test-hub

types-of-load-tests

Let us discuss these tests one by one.

Load Test HTTP Achieve (HAR)

We can use HAR testing to create load tests for end-to-end scenario.

Visual Studio Load Testing will give us maximum capabilities, but HAR also provides some limited features. We can write tests which can support multiple URLs.

Let us find out how to create HTTP Achieve file. I have done it using Microsoft Edge but you can also use it in Chrome, Firefox or Internet Explorer.

Launch a browser and click on F12 to open developer tools

You can preserve the logs if required as follows:

preserve-logs

Follow the scenario you want to test, enter the url in the address bar. I am going to use Web App Service for EMS app

As you proceed with your application, the traffic is shown in the Network tab.

traffic-shown-in-network

- After you have finished, you can store this as a HAR file by clicking on the Export button

export-har-file

Now that the HAR file is ready, you can create a Load Test based on this file. Browse to the location where the file is stored

import-har-file

Save the file. Now you can set the settings for this scenario like run duration, load patterns (constant or step), browser mix, number of virtual users etc.

settings-har-test

The URLs we had specified at the time of creating HAR file will be picked up. We can do any editing if required.

Once the changes are made and the file saved, we can run the tests. The data after the run will be available in Diagnostics and Logs tab. If the test fails, we can find more information from these logs.

Here are some charts after running the tests:

url-based-charturl-based-chart2

The diagnostics can be seen as follows:

url-based-diagnostics

url-based-diagnostics2

We can even export the test to Visual Studio 2017 Enterprise and add more capabilities to it.

Load Testing with Visual Studio 2017 Enterprise

  • We can export the HTTP archive file into Visual Studio Load Test or create a standalone load test in Visual Studio. Load testing comes after functional tests are written and tested. We need to provide a mix of functional tests (their load), browser mix, network mix, step or constant load for users.
  • We can run this load test either by using on-premises load agent or controller or Test Hub. I will write more on creating load test with Visual Studio 2017 Enterprise in an upcoming article.
  • With test hub, we can select the option for Visual Studio Test and can browse to the folder where the test is available. Any Web Performance test created earlier can be selected for this.
  • Once the test is selected we can change the settings and run it any time

URL based Load Testing

  • Select the option for URL based test and provide the name for the test.
  • You can provide a URL you want to test in URL text box. You can add multiple URLs and specify method for each like POST or PUT. You can also add headers and query string if these are required to be sent as values to the requests.
  • You can then set the settings and run test
 

Apache JMeter Testing

Apache JMeter is an Open Source tool used to do load testing of applications. This is meant for Java Applications for load testing and measuring performance. It can be used to test static resources like JavaScript and HTML as well as dynamic resources like JSP, servlets and even Ajax.

It can find out the maximum number of concurrent users a web application can handle. Once you have a JMeter test, you can easily execute it with VSTS.

Conclusion

In this load testing tutorial, I discussed what is Load Testing and how VSTS Test hub provides different types of Load Testing.

What Others Are Reading!
Was this article worth reading? Share it with fellow developers too. Thanks!
Share on LinkedIn
Share on Google+

Author
Gouri Sohoni is a Trainer and Consultant for over two decades. She specializes in Visual Studio - Application Lifecycle Management (ALM) and Team Foundation Server (TFS). She is a Microsoft MVP in VS ALM, MCSD (VS ALM) and has conducted several corporate trainings and consulting assignments. She has also created various products that extend the capability of Team Foundation Server.


Page copy protected against web site content infringement 	by Copyscape




Feedback - Leave us some adulation, criticism and everything in between!

Categories

JOIN OUR COMMUNITY

POPULAR ARTICLES

FREE .NET MAGAZINES

Free DNC .NET Magazine

Tags

JQUERY COOKBOOK

jQuery CookBook