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.
Web Service URL : http://localhost:24240/HPFlights_SOAP?wsdl
Steps to Create Web Services Script
STEP 1:
1.Create a New Script with Web Services Protocol and Enter Solution Name.
2.Click on Create
STEP 2:
Loadrunner creates below details in Solution Explorer
1.Actions – vuser_init() , Action() and vuser_end()
2.ExtraFiles – globals.h
3.Run-Time Settings
4.Parameters
5.Replay Runs[No Runs]
STEP 3:
Now you need to import WSDL URL from SOA Tools menu.
Go to SOA Tools – Click on Manage Services.
It will open Manage Services Window and below options it will display
1.Import
2.Description
3.Operations
4.Connection Settings
5.UDDI Data
6.Protocol and Security
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.
STEP 4:
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.
![]() |
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.
STEP 5:
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.
Enter Input Arguments,Select Output Argument.
Click on OK button,now your generated script look like below.
STEP 6:
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.
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
Replay 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.
Thank you.Well it was nice post