Canarys | IT Services

Blogs

Load testing using Visual Studio – 2013

Date:
Author:
Share

Load testing using Visual Studio – 2013
 
To run load test, we first have to create web-performance test. Let us now look how to create web-performance test and how to perform load test on web-performance test.
Tester should make sure that all regression tests are completed and system is stable before proceeding to load testing.
Note: Load testing can be run/created only when web-performance test is 100% passed.
 
Steps to create Web-performance test in VisualStudio

Open Visual Studio Ultimate 2013.

Create web performance and load test project.

File => New Project => Visual C# => Test => Web Performance and Load Test Project.

4. Click OK to save the project and enter into solution explorer.
 
How to record Web Performance Test

Create web performance test.

  
   web browser will open (Default: IE browser).

Enter URL of the website to test.

  

When the test URL page is opened, browse the website as normal user or browse based on the scenarios to test. Ex: login/logout to user account or browse and add products to the cart basket.

             The respective HTTP requests and responses will be captured by the recorder.

Stop recording when done.

  

Rename the test for usability. Ex: OnlineShopping.Webtest. Providing relavent names help us to find the tests more quick.

  

Edit test properties and specify performance goals. Ex: Set page response time goal to 1 second.

  

Save the test.

 
Creating Load Test

Open a Web performance and load test project which is created.

In Solution Explorer, right-click the Web performance and load test project node, choose Add, and then choose Load Test.

  
The New Load Test Wizard will be displayed in new window which starts with Welcome page.
 
New Load Test Wizard Steps
Step 1 – Launching the New Load Test Wizard:
         
The welcome page contains certain information of how to create the load test. Click Next to continue further in load testing.
 
Step 2 – Creating and Changing a Scenario: Create and name the scenario associated with load test. Select the think time profile and provide think time between test iterations.
Think times simulate pausing between steps in the tests included in the load test.
         
After choosing the Scenario page settings, click Next to continue.
 
Step 3 – Choosing a Load Pattern: In this step, we can select the type of load test pattern to specify number of virtual users who are active and speed at which new users are added.
Following are two types of load pattern available to choose during load test.

Constant: The constant load pattern allows to specify number of users that do not change during the load test. Ex: Constant load of 10 users throughout the test.

Step: The step load pattern allows to specify number of user load that increases with time up to defined maximum user load. For step load, specify the properties as shown in below snapshot  

After choosing the load pattern settings, click Next to continue.
 
Step 4 – Choosing a Test Mix Model: This step allows us to configure initial test mix model for the load test. This selection help us to predict the real-world usage of a Web site or application.
       
After choosing the test mix model, click Next to continue.
 
Step 5 – Specifying Test Mix: This step allows us to add recorded “web performance” test(s) to load test scenario.
       
Click on Add to select the web performance test(s).
      
Move the web performance test(s) to the selected tests list to run.
Post selecting the web performance test(s) to run, Select the desired test mix by changing the sliders in Distribution column or by typing the percentage values directly into the % column.
       
After choosing the test mix settings, click Next to continue.
 
Step 6 – Specifying Network Mix: Configuring the network for load test. We can add one or more network types to load test scenario.
        
After choosing the network mix, click Next to continue.
 
Step 7 – Specifying Browser Mix: Configuring the web browser for load test scenario. We can add one or more browser types to use with load test. The browser mix option is showed only if Web performance test was involved in test mix.
        
After choosing the browser mix, click Next to continue.
 
Step 8 – Specifying Counter Sets: Counter sets are set of system performance counters that are useful to monitor during the load test. In this step, specify the computers and their associated counter sets that want to use in the load test.
        

On the Counter Sets page, we can see the existing counter sets in the Preview selections pane.

Click on Add Computer to add application deployed server name and it's counters for monitoring. When clicked on Add computer, will be prompted for a name. Type the name of server computer and we will see nodes below the new entry that you can select. Ex: ASP.NET, IIS, SQL, etc. Select the check boxes in front of the nodes that you want to select. The new counters appear in the Preview selections pane.

         
After choosing the counter sets, click Next to continue to the Run Settings page.
 
Step 9 – Specifying Run Settings: This is the last step in load testing. In this step we configure the initial run setting for the load test.
Run settings are more important because they determine properties such as length of the test, warm-up duration, maximum number of error details reported, sampling rate, etc. The run settings should reflect the goals of the load test.
        
Specify length of the load test by choosing one of the following options:

Use Specified duration

Select the Load test duration option.

Specify the Warm-up duration (hh:mm:ss). Use the hour, minute and second spin controls.

Specify the Run duration (hh:mm:ss). Use the hour, minute and second spin controls.

Use Specified iterations

Select the Test iterations option.

Specify the number of times to run the test. Use the Test iterations spin control.

Under Detail section, configure the following options:

Use the Sampling rate spin control to specify the number of seconds between gathering sampling data.

In the Description text box, type a description of the load test.

Use the drop-down list box for Save Log on Test Failure to specify True to save the log file or False if do not want to save the log file.

Use the drop-down list box for Validation level to select one of the following options:

High – invoke all validation rules

Medium – invoke validation rules marked medium or low

Low – invoke validation rules marked low

         
Click on Finish to complete the LoadTest settings. If any changes use the orientation panel on the left hand side to return to any previous step.
 
When finish the wizard, the web performance test is added to the load test and appears in the load test editor.
 
Now, the LoadTest is created successfully and Run the load test to verify the performance results.
 
 
Upon selecting Run Load test, the load test initialises in a separate window. The window consists of Performance Graphs in four panels by default showing the key statistics and performance counter results below the panels.
         
 
When total test run is completed for the specified duration (Ex: 10min), load test summary report is displayed as shown below.

 
Waiting to analyse Performance results and finding bottlenecks??
Then why do late, Subscribe to our blogs and keep yourself updated with the new posts.
 
Happy Load Testing….
 
                    

Leave a Reply

Your email address will not be published. Required fields are marked *

Reach Us

With Canarys,
Let’s Plan. Grow. Strive. Succeed.