3. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
Table of Contents
Chapter 1: Introduction.......................................................................................................................2
Load testing introduction ................................................................................................................2
Difference Betweenload 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
Executingload test........................................................................................................................20
Generating Report........................................................................................................................21
http://testingtoolstecniques.blogspot.com/
Chapter 1: Introduction
Load testing introduction
Load testingisthe processof puttingdemandona systemor device andmeasuringitsresponse.Load
testingisperformedtodetermine asystem’sbehaviorunderbothnormal andanticipatedpeakload
conditions.Ithelpstoidentifythe maximumoperatingcapacityof anapplicationaswell asany
bottlenecksanddeterminewhichelementiscausingdegradation.Whenthe loadplacedonthe system
israisedbeyondnormal usage patterns,inordertotestthe system'sresponse atunusuallyhighorpeak
loads,itis knownas stresstesting.The loadisusuallysogreatthat error conditionsare the expected
result,althoughnoclearboundaryexistswhenanactivityceasestobe aloadtest andbecomesa stress
test.
4. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
Difference Between load and performance test
Performance testing:
“In the computerindustry,software performance testingisusedtodetermine the speedor
effectivenessof acomputer,network,software programordevice.Thisprocesscaninvolve quantitative
testsdone ina lab, suchas measuringthe response time orthe numberof MIPS(millionsof instructions
persecond) at whicha systemfunctions.Qualitative attributessuchasreliability,scalabilityand
interoperabilitymayalsobe evaluated.Performance testingisoftendone inconjunctionwithstress
testing.”
Load Testing:
Load testingismeantto testthe systembyconstantlyandsteadilyincreasingthe loadonthe systemtill
the time itreachesthe thresholdlimit.Itisthe simplestformof testingwhichemploysthe use of
automationtoolssuchas Visual Studiooranyothergood tools,whichare available.Loadtestingisalso
famousbythe nameslike.
Difference:
Load Testing Performance Testing
Load testingismeantto testthe systemby
constantlyandsteadilyincreasingthe loadonthe
systemtill the time itreachesthe thresholdlimit
Performance testingismeasuringquality
characteristicsof an applicationlike‘Response
Time’,‘Processorutilization‘etc
It Is usedtodetermine what’sthe peaklimitof
requestunderwhichourapplicationcanwork
fine
Performance testingisused todetermine
performance characteristicse.g.what’sthe
response of a certainfunctionality.
The goals of loadtestingare to expose the
defectsinapplicationrelatedtobufferoverflow,
memoryleaksandmismanagementof memory
The primarygoal of performance testingincludes
establishingthe benchmarkbehaviorof
the system.There are a numberof industry-
definedbenchmarks,whichshouldbe metduring
performance testing.
How it’s used:
NormallyPerformanceTestandLoad testare performedtogetherbecause whenugenerate ahigh
volume loadonthe otherhand u have to measure responsetime processorutilizationandotherquality
characteristics
Process of Creating load Test in Visual Studio
These Diagramwill explainabasicloadtestcreation invisual studio.
5. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
Guidelines for a Good load test.
Load testshouldsimulate crateristicsof areal useras close aspossible e.g.onsigninwhatcan userdo
he can provide validorinvalidbothtype of credentials.
Load Testmust be provideda meaningfull data.
TestData mustbe createdafter analyzingthe processandall possibletype of datathat can be usedina
certainfunctionalitymustbe incorporatedsothatdifferenttypesof behaviorscanbe simulated
Resources required for load testing With VSTS.
Resourcesrequiredforaloadtestwithvisual studioare
Software Requirements:
Visual StudioUltimate
SQL Server
MicrosoftExcel
Hardware Requirements:
It dependsonloadtest
Chapter 2: Creating Web Application Performance Test
In thischapterwe will explainhowtocreate a Load testfor a Web Application.Aswe know aweb
applicationworksonHTTP requests,basicallyload testisdone againstthese HTTPrequestsitdoesn’t
6. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
clickany GUI elementsortypesinfielde.gwhenyouregisteronapplicationitcallssome GET POST
methodrecorderrecordsthisGET POSTmethodinsteadof recordingin whichelementsusertypedorhe
clicked.
Creating a Load Test Project
Firststepof creatinga loadtest Project.To-doso performfollowingsteps
Steps:
1. OpenVisual StudioInstance
2. Create a NewProjectByclickingNew > Project….
3. Click“Test”and thenselect“WebPerformance and LoadTest Project”withC#,Provide any
Suitable name andclick“OK”.
7. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
4. AfterCreatingProject
Creating a Performance Test Using Recorder
SecondStepisto create a performance testitcanbe createdusinga recorderor directlycallingHTTP
requestshere we will recordHTTPrequestsusingrecorder.
Steps:
1. To Adda Performance TestLeftClickyourprojectandopenAdd> Web Performance Test.
Note:A Web Testwill be automaticallyaddedandyoucanalsorename that if desired
2. Nowto Start RecorderClickRecordiconOn Visual StudioItwill startrecorderinIE.
9. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
4. Wait forsome time Visual Studiowill be detectingsome dynamicparametersautomaticallye.g
SessionID
GeneratedScriptwill looklike the below screenshot
Parameterize recorded script
As we knowinloadTest will simulate multiple Userstherefore insome casesall userneedaunique data
settherefore it’sveryimportanttoParameterize load.Tothisfollowingstepsare requiredtobe done
1. IdentifyFields/Parameterse.g.insignin twoparametersmustbe dynamicIDand Password.
2. ExpandYour Requestwhichishavingparameters.
As youcan see PasswordandID, These twoParametersare neededtobe dynamic
10. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
3. We require adata source to bindour parameterwithadata in Excel or SQL ServerTable.Todo
thisCreate a data source by clickhighlightedIcon.
4. If you wantto fetchdata for parametersfroma CSV file selectCSelse selectDatabase.
In case of SQL Servercreate a connectionwithD.Bbyperformingrequiredstepsandatlast
selectingtable.
5. Afteraddingdatasource viewwill be like this.
12. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
Nowparametervalue will looklike this
7. Save your test
Chapter 3: Load Testing Soap Web service
In thischapterwe will explainhowtocreate a Load testfor a Web Service.Aswe know aAndroid,Web
and differenttype of applicationare builtonSOAPWebservices , basicallyloadtestisdone against
these SOAPWebservices requests.
Creating a Load Test Project
Firststepof creatinga loadtestProject.To-doso performfollowingsteps
Steps:
5. OpenVisual StudioInstance
6. Create a NewProjectByclickingNew > Project….
13. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
7. Click“Test”and thenselect“WebPerformance andLoadTest Project”withC#,Provide any
Suitable name andclick“OK”.
8. AfterCreatingProject
Creating a Performance Test Using Recorder
SecondStepisto create a performance testitcanbe createdusinga recorderor directlycallingHTTP
requestshere we will recordHTTP requestsusingrecorder.
Steps:
14. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
1. To Adda Performance TestLeftClickyourprojectandopenAdd> Web Performance Test.
Note:A Web Testwill be automaticallyaddedandyoucanalsorename that if desired
2. If recorderopensclose itotherwise simplyleft clickyourtestandclick“Add WebService
Request” .
3. Change local hostpost methodtouserWeb service addressfrompropertiesatleftpane
15. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
4. In BodyPropertiesSelectContentType asText/XMLand in StringBodyprovide yourXML .
E.g. Please note use SOAP1.2Requestaswe are using.netframe work4.0 or 4.5
Clickok
Parameterize script
As we knowinloadTest will simulate multiple Userstherefore insome casesall userneedaunique data
settherefore it’sveryimportantto Parameterize Request. Tothisfollowingstepsare requiredtobe
done
16. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
1. We require adata source to bindour parameterwithadata in Excel or SQL ServerTable.Todo
thisCreate a data source by clickhighlightedIcon.
2. If you wantto fetchdata for parametersfroma CSV file selectCSelse selectDatabase.
In case of SQL Servercreate a connectionwithD.Bbyperformingrequiredstepsandatlast
selectingtable.
3. Nowopenthe webservice bodyXML andfor parameterizingaparametertype initstag
{{DataSource.Name of CSVfile .FieldName}} e.g. {{DataSource1.test#csv.ID}}
Thisway parameterize all requiredparametersof webservice.
17. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
Chapter 3: Creating Load test against Performance test
Add load test
Nowaftercreatinga performance testyouneedtocreate a loadtestagainstit.To do so perform
followingsteps.
Steps:
1. Leftclickprojectand open
2. A windowwill openclicknext
22. Fahad Shaikh
http://testingtoolstecniques.blogspot.com/
Whenloadtestwill startfollowinggraphswillbe shown
Generating Reporti
There are differentwaysof generatingaloadtestreport one isto automaticallycreatingreport using
excel andsecondone ispreparingreportyourself-havingonlyrequireddatawhatI normallyrequire is
response time anditsgraphsI simplymake reportlike the one mentionedbelowinemail formbutit
dependsonneed.