Load Testing Soap Web service with MS Visual Studio 2013


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:
  1. Open Visual Studio Instance
  1. Create a New Project By clicking New > Project….
  1. Click “Test” and then select “Web Performance and Load Test Project” with C#, Provide any Suitable name and click “OK”.
  1. 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
  1. If recorder opens close it otherwise simply left click your test and click “Add Web Service Request”  .

  1. Change local host post method to user Web service  address from properties at left pane

  1. 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  
  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.
  1. 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.
  1. 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.

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

  1. A window will open click next

Name your scenario , Select Think time  and click Next
Select Users count as per your requirement and test machine specifications.

Select Test Model
Add your Performance Test By clicking add which would be included in Load test

Select Your test

In this way configure your load test and continue

Executing load test.

After Doing All configurations simply start Load test
When load test will start following graphs will be shown

Generating Report

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 .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s