Web Services Scripting Using Loadrunner

Web Services Scripting Using Loadrunner

Web services scripting using loadrunner tutorial gives you clear details with real time examples,in my previous post i have given prepare script for REST API in loadrunner please go through once.

What Are Web Services?

Web Services are client and server based applications which communicate on the world wide web’s(WWW) and HTTP – Hyper Text Transfer Protocol.Web Services includes SOAP,REST and JSON implementations,with the help of Web Services applications communicates with another systems/applications or transfer data from one system to another system.

Also Read:

lr_xml_find examples
Loadrunner Actions
Create a script for REST API
Design Goal Oriented Scenarios

Web Services Scripting Using Loadrunner

Web Services scripting in loadrunner is very easy to create with the help of Web Services protocol,Manage Services,Add Service Call options in Virtual User Generator(VUGen),I am using Flight Application Web Service for example to explain more clearly with step by step for creating scripting for Web Services.

ALSO READ  REST API Services Testing using loadrunner

Web Service URL : http://localhost:24240/HPFlights_SOAP?wsdl

Steps to Create Web Services Script

1.Create a New Script with Web Services Protocol and Enter Solution Name.
2.Click on Create

Web Services Scripting using Loadrunner
Create a New Web Services Script

Loadrunner creates below details in Solution Explorer
1.Actions – vuser_init() , Action() and vuser_end()
2.ExtraFiles – globals.h
3.Run-Time Settings
5.Replay Runs[No Runs]

Web Services Script in Loadrunner
Web Services Action Explorer

Now you need to import WSDL URL from SOA Tools menu.
Go to SOA Tools – Click on Manage Services.

Web Services Scripting using Loadrunner

It will open Manage Services Window and below options it will display
4.Connection Settings
5.UDDI Data
6.Protocol and Security

Loadrunner Web Services Scripting
SOA Tools Manage Services

Click on Import.
Select WSDL From as URL,Enter wsdl URL : http://localhost:24240/HPFlights_SOAP?wsdl
Click on Import button.
Now Manage Services window will display WSDL details in Description and Operations tabs,all details it will display in this tabs.
Click on OK button.

ALSO READ  How to Design a Goal Oriented Scenario

In this step we will add input parameters test data and output parameters values in Add Service Call menu from SOA Tools.
Go to SOA Tools – Click on Add Service Call.

Web Services Call
Add Service Call

Add Service Call window will open with following options
1.Select Web Service Call
2.Service drop down
3.Port Name drop down
4.Operation Drop down
5.Target Address : WSDL URL
6.Selected Operation Input Arguments , Output Arguments to select and enter your Test Data.

Loadrunner Web Services Scripting
New Web Service Call

Click on Input Arguments option and Click on + symbol to enlarge or to view input parameters.
As you see below SOAP service Request and Response,same details we need to add in input arguments in Loadrunner.

Web Services Scripting
Web Services Soap UI

Enter Input Arguments,Select Output Argument.

Web Services Scripting using Loadrunner
New Web Service Call – Input Output Arguments

Click on OK button,now your generated script look like below.

ALSO READ  Transactions in Loadrunner

Now it’s time to change Run Time Settings ,in Run Time Settings(Loadrunner Run Time Settings) select Log option and Select below check boxes on
1.Extended Log
2.Parameter Substitution
3.Data Return By Server
4.Advanced Trace
With the help of Extended log options all the parameter substitutions,return by the server details will displays in Replay Log summary.

Loadrunner Web Services Settings
Run Time Settings

Click on OK and SAVE your script.
Now Run your script to verify test script executes properly or not /provides proper response in VUGen.

Replay Status


Web Services Scripting using Loadrunner
Web Services Script Execution Reply Log


Replay Summary


Web Services Scripting Using Loadrunner
Web Services Scripting Reply Summary

Please read Web Services Scripting Using Loadrunner – PART 2 ,lesson you will learn how to create parameterization in the Test Scripts,How to run Number of iterations and How to use Transactions in the scripts to verify response time between the transactions.


Rajesh has over 8+ years of experience in Quality Assurance (Automation/ Manual). I've completed his B.Texh. He is an experienced software tester,work experience include working on tools like TestNG, Sikuli, Autoit, Selenium Builder and Appium, has worked on various projects from verticals like Retail, Insurance, Tolling and many more and passionate about designing Automation Frameworks that are effective and easy to maintain using Selenium Java.

One thought on “Web Services Scripting Using Loadrunner

Comments are closed.