When we develop any website or app, it is required to check its performance before launching it to the production or live environment. Performance load testing checks the website ability to perform under anticipated user loads. The main objective of load testing is to identify performance bottlenecks before the application goes live. With this, we can find out the performance issues or problems before the end user faces it and report that to us.

Pre-requisites

To perform load testing we need to have the following:

  1. Visual Studio 2017 Enterprise edition, it can be downloaded here, if not already installed.
  2. A VSTS account, we can create our account here, if the account is not already created. Any access level will work to perform/run load test using Visual Studio Enterprise.

Connecting to VSTS

To create and run the load test in a cloud, connect Visual Studio to a VSTS account

  1. Go to Team Explorer and click Manage Connection and then Connect to a project
    Figure 1 Connecting to VSTS - Team ExplorerFigure 1 Connecting to VSTS – Team Explorer

 

  1. The Manage connection popup will display the list of repositories which have been already added to the visual studio previously. We can add our account by clicking Add an account option and providing credentials.
  2. Now it will connect to our VSTS account and will display a list of VSTS repositories associated with that account.
  3. Select the VSTS account repository which is to be used from the list and select the team project, then click Connect.

Figure 2 Connecting to VSTS - Add account and select team project

Figure 2 Connecting to VSTS – Add account and select team project

Now the Visual studio is connected to the VSTS account, we can start creating the load test project

Creating a load test project

  1. In Visual Studio create a new project using “Web performance and Load test project” template placed inside Test projects templates as below

 

Figure 3 Create Load test project

If we cannot find this template in Visual Studio, it means it is not installed. In this case, we need to install the web performance test template project. Follow below steps to install this

  1. Run the Visual Studio 2017 Installer
  2. Switch to Individual Component tab and open Debugging and testing section
  3. Check “Web performance and load testing tools” option

Now we can find the test template in Visual Studio and can create the project.

  1. Open the file with the extension “. webtest” (it will be opened automatically when a project is created)
  2. Right click on WebTest à click Add Request. It will add a request with localhost as shown in the image below:

Figure 4 Add request in the web test

 

Figure 5 Web test request URL

  1. We can replace the localhost URL with our actual website URL in the Request properties window as below

 

Figure 6 Request properties

  1. We can also add Validation rules for the web test, right-click WebTest project and then

click Add Validation Rule

 

  1. Specify the rules and properties in the next screen and click OK

Figure 8 Add Validation rule in web test -2

  1. We can see the web test as below

Figure 9 Webtest

  1. Now Right click the project and Add a Load test

 

Figure 10 Add Load test in the project

  1. It will open the New load test wizard to specify the load test settings, we can select the type of load test whether it will be cloud-based or On-premise load test and click Next to specify the other settings.

 

Figure 11 Set load test type

  1. We can select the Azure data center location from where the load will be generated. It should be selected considering the user’s location, we can select the location which is closer to the users of the website and click Next

 

 

Figure 12 Set load test location

  1. We can specify the run settings like test duration or iterations and click Next

Figure 13 Set test duration and Iteration

  1. It contains a list of scenarios which can be added to the load test like Load pattern, Browser mix or test mix and click Next

 

Figure 14 Set test load pattern

  1. On this screen we can specify the test mix like how the test will be executed, based on total number of tests or Virtual users etc. and click Next

 

Figure 15 Set test model behavior

  1. We can add the tests here which are previously created, the tests will have the web request URL.
  2. Select the test
  3. Move it to the selected tests area
  4. Click OK

Figure 16 Add web tests to the test

 

  1. We can specify browsers to test the performance, we can add multiple browsers and can set the distribution ratio for the load test with different browsers.

Figure 17 Add browsers to perform the test with

 

  1. Click Finish and it will create the Load test, we can check and edit the test properties from the properties window as below

 

 

 

 

 

Figure 18 Load test

Run the load test

Now as we have created the load test, so we can run the load test to test the website performance with the parameters specified at the time of load test creation like duration, a number of users, browser etc.

  1. Right-click on the Run setting and click Run Load Test, it will run in the Cloud using VSTS

Figure 19 Run load test

 

  1. It will build the solution and will start initializing the load test as below.

 

Figure 20 Load test In-Progress

  1. It shows the progress and performance of the Graph and details tab. We can check the website performance when the test is running, we can also check for errors, warnings, and information about the test.

Figure 21 Load test showing performance graph

  1. It displays Completed status when the test is 100% done. It shows the Performance graph and other details in the test result, we can also Download the test report or can open the Web report in VSTS portal to view the test results.

Figure 22 Load test with the result

The test results include performance counter data, threshold violations, and error information. We can review the test result and can find out the number of users where the website performance is not good.

We can fix the performance issues and can run the test again before deploying the website to production to ensure the website launch with high performance.

 

Posted by Advaiya

    Let's connect to make technology work for you.





    Please tick the options most relevant to your business challenges
    Decision makingBusiness productivityCustomer experienceTechnology-led innovationDigital transformation


    [By using this form you agree with the storage and handling of your data by this website.]