0% found this document useful (0 votes)
28 views23 pages

Load Testing with Visual Studio

The document discusses creating load tests in Visual Studio. It begins with an introduction to load testing and outlines the process for creating a load test project in Visual Studio. It then provides steps for creating a web application performance test using the recorder to capture HTTP requests. The document emphasizes the importance of parameterizing the recorded script so that multiple virtual users can be simulated with unique data. Finally, it briefly discusses how to create a load test against the performance test and generate reports of the results.

Uploaded by

Ashihs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views23 pages

Load Testing with Visual Studio

The document discusses creating load tests in Visual Studio. It begins with an introduction to load testing and outlines the process for creating a load test project in Visual Studio. It then provides steps for creating a web application performance test using the recorder to capture HTTP requests. The document emphasizes the importance of parameterizing the recorded script so that multiple virtual users can be simulated with unique data. Finally, it briefly discusses how to create a load test against the performance test and generate reports of the results.

Uploaded by

Ashihs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

0

LOAD TESTING WITH VISUAL


STUDIO

Fahad Sheikh
HTTP://TESTINGTOOLSTECNIQUES.BLOGSPOT.COM/ fs [email protected]
http://testingtoolstecniques.blogspot.com/
FAHAD SHEIKH 0
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Table of Contents
Chapter 1: Introduction.......................................................................................................................2
Load testing introduction ................................................................................................................2
Difference Between load and performance test ................................................................................3
Performance testing: .................................................................................................................3
Load Testing:..............................................................................................................................3
Process of Creating load Test in Visual Studio ...................................................................................3
Guidelines for a Good load test........................................................................................................4
Resources required for load testing With VSTS. ................................................................................4
Chapter 2: Creating Web Application Performance Test ........................................................................4
Creating a Load Test Project ............................................................................................................5
Creating a Performance Test Using Recorder....................................................................................6
Parameterize recorded script...........................................................................................................8
Chapter 3: Load Testing Soap Web service ......................................................................................... 11
Creating a Load Test Project .......................................................................................................... 11
Creating a Performance Test Using Recorder.................................................................................. 12
Parameterize script....................................................................................................................... 14
Chapter 3: Creating Load test against Performance test ...................................................................... 16
Add load test ................................................................................................................................ 16
Executing load test........................................................................................................................ 20
Generating Report ........................................................................................................................ 21

http://testingtoolstecniques.blogspot.com/

Chapter 1: Introduction
Load testing introduction
Load testing is the process of putting demand on a system or device and measuring its response. Load
testing is performed to determine a system’s behavior under both normal and anticipated peak load
conditions. It helps to identify the maximum operating capacity of an application as well as any
bottlenecks and determine which element is causing degradation. When the load placed on the system
is raised beyond normal usage patterns, in order to test the system's response at unusually high or peak
loads, it is known as stress testing. The load is usually so great that error conditions are the expected
result, although no clear boundary exists when an activity ceases to be a load test and becomes a stress
test.
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Difference Between load and performance test


Performance testing:
“In the computer industry, software performance testing is used to determine the speed or
effectiveness of a computer, network, software program or device. This process can involve quantitative
tests done in a lab, such as measuring the response time or the number of MIPS (millions of instructions
per second) at which a system functions. Qualitative attributes such as reliability, scalability and
interoperability may also be evaluated. Performance testing is often done in conjunction with stress
testing.”

Load Testing:
Load testing is meant to test the system by constantly and steadily increasing the load on the system till
the time it reaches the threshold limit. It is the simplest form of testing which employs the use of
automation tools such as Visual Studio or any other good tools, which are available. Load testing is also
famous by the names like .

Difference:

Load Testing Performance Testing


Load testing is meant to test the system by Performance testing is measuring quality
constantly and steadily increasing the load on the characteristics of an application like ‘Response
system till the time it reaches the threshold limit Time’ , ‘Processor utilization‘ etc
It Is used to determine what’s the peak limit of Performance testing is used to determine
request under which our application can work performance characteristics e.g. what’s the
fine response of a certain functionality.
The goals of load testing are to expose the The primary goal of performance testing includes
defects in application related to buffer overflow, establishing the benchmark behavior of
memory leaks and mismanagement of memory the system. There are a number of industry-
defined benchmarks, which should be met during
performance testing.

How it’s used:

Normally Performance Test and Load test are performed together because when u generate a high
volume load on the other hand u have to measure response time processor utilization and other quality
characteristics

Process of Creating load Test in Visual Studio


These Diagram will explain a basic load test creation in visual studio.
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Guidelines for a Good load test.


Load test should simulate crateristics of a real user as close as possible e.g. on sign in what can user do
he can provide valid or invalid both type of credentials.

Load Test must be provided a meaning full data.

Test Data must be created after analyzing the process and all possible type of data that can be used in a
certain functionality must be incorporated so that different types of behaviors can be simulated

Resources required for load testing With VSTS.


Resources required for a load test with visual studio are

Software Requirements:

Visual Studio Ultimate

SQL Server

Microsoft Excel

Hardware Requirements:

It depends on load test

Chapter 2: Creating Web Application Performance Test


In this chapter we will explain how to create a Load test for a Web Application. As we know a web
application works on HTTP requests, basically load test is done against these HTTP requests it doesn’t
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

click any GUI elements or types in field e.g when you register on application it calls some GET POST
method recorder records this GET POST method instead of recording in which elements user typed or he
clicked.

Creating a Load Test Project


First step of creating a load test Project. To-do so perform following steps

Steps:

1. Open Visual Studio Instance

2. Create a New Project By clicking New > Project….

3. Click “Test” and then select “Web Performance and Load Test Project” with C#, Provide any
Suitable name and click “OK”.
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

4. After Creating Project

Creating a Performance Test Using Recorder


Second Step is to create a performance test it can be created using a recorder or directly calling HTTP
requests here we will record HTTP requests using recorder.

Steps:

1. To Add a Performance Test Left Click your project and open Add > Web Performance Test.

Note: A Web Test will be automatically added and you can also rename that if desired
2. Now to Start Recorder Click Record icon On Visual Studio It will start recorder in IE.
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

3. Perform you Steps and recorder will automatically record HTTP Request
Here I am Performing
Open login.live.com/
Provide Id and Password (Note: here I am using dummy credentials)
Click Sign in
U will see some HTTP requests recorded on left side of screen
After Recording Click STOP.
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

4. Wait for some time Visual Studio will be detecting some dynamic parameters automatically e.g
Session ID

Generated Script will look like the below screen shot

Parameterize recorded script


As we know in load Test will simulate multiple Users therefore in some cases all user need a unique data
set therefore it’s very important to Parameterize load. To this following steps are required to be done

1. Identify Fields / Parameters e.g. in sign in two parameters must be dynamic ID and Password.
2. Expand Your Request which is having parameters.

As you can see Password and ID, These two Parameters are needed to be dynamic
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

3. We require a data source to bind our parameter with a data in Excel or SQL Se rver Table. To do
this Create a data source by click highlighted Icon.

4. If you want to fetch data for parameters from a CSV file select CS else select Data base.

In case of SQL Server create a connection with D.B by performing required steps and at last
selecting table.

5. After adding data source view will be like this.


Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

6. Left Click Parameter and expand list and then select field of table in data source here I am
selecting from CSV

Expand data source

Expand Table/CSV

Select Field
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Now parameter value will look like this

7. Save you r test

Chapter 3: Load Testing Soap Web service


In this chapter we will explain how to create a Load test for a Web Service. As we know a Android, Web
and different type of application are built on SOAP Web services , basically load test is done against
these SOAP Web services requests.

Creating a Load Test Project


First step of creating a load test Project. To-do so perform following steps

Steps:

5. Open Visual Studio Instance

6. Create a New Project By clicking New > Project….


Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

7. Click “Test” and then select “Web Performance and Load Test Project” wi th C#, Provide any
Suitable name and click “OK”.

8. After Creating Project

Creating a Performance Test Using Recorder


Second Step is to create a performance test it can be created using a recorder or directly calling HTTP
requests here we will record HTTP requests using recorder.

Steps:
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

1. To Add a Performance Test Left Click your project and open Add > Web Performance Test.

Note: A Web Test will be automatically added and you can also rename that if desired
2. If recorder opens close it otherwise simply left click your test and click “Add Web Service
Request” .

3. Change local host post method to user Web service address from properties at left pane
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

4. In Body Properties Select Content Type as Text /XML and in String Body provide your XML .
E.g. Please note use SOAP 1.2 Request as we are using .net frame work 4.0 or 4.5
Click ok

Parameterize script
As we know in load Test will simulate multiple Users therefore in some cases all user need a unique data
set therefore it’s very important to Parameterize Request. To this following steps are required to be
done
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

1. We require a data source to bind our parameter with a data in Excel or SQL Server Table. To do
this Create a data source by click highlighted Icon.

2. If you want to fetch data for parameters from a CSV file select CS else select Data base.

In case of SQL Server create a connection with D.B by performing required steps and at last
selecting table.
3. Now open the web service body XML and for parameterizing a parameter type in its tag
{{DataSource.Name of CSV file .Field Name}} e.g. {{DataSource1.test#csv.ID}}

This way parameterize all required parameters of web service.


Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Chapter 3: Creating Load test against Performance test


Add load test
Now after creating a performance test you need to create a load test against it. To do so perform
following steps.
Steps:

1. Left click project and open

2. A window will open click next


Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Name your scenario , Select Think time and click Next

Select Users count as per your requirement and test machine specifications.
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Select Test Model


Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Add your Performance Test By clicking add which would be included in Load test
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

Select Your test

In this way configure your load test and continue

Executing load test.


After Doing All configurations simply start Load test
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

When load test will start following graphs will be shown

Generating Report i
There are different ways of generating a load test report one is to automatically creating report using
excel and second one is preparing report your self-having only required data what I normally require is
response time and its graphs I simply make report like the one mentioned below in email form but it
depends on need .
Fahad Shaikh
http://testingtoolstecniques.blogspot.com/

References:
http://testingtoolstecniques.blogspot.com/

i You can follow my posts on http://testingtoolstecniques.blogspot.com/

You might also like