How to do Soap Call Testing in LoadRunner: LoadRunner is one most popular licensed performance testing tools, Micro Focus owns LoadRunner, and it manages for new LR versions, LR supports almost all types of recording and executes protocols like Mobile, Web, Database, Java, Web sockets, etc performance testing.

LoadRunner is Made of 3 components which are Vugen, Controller, and Analysis, 3 component is mandatory to complete performance testing, These 3 components are used to do end-to-end testing.

How to do Soap Call Testing in LoadRunner

VuGen is generally used to record user flow and enhance them to work for multiple users and add dynamic data as input using parameterized and correlation to support multiple users. Adding page assertions will be validating the page is a valid response or not

In VuGen we have multiple protocols like HTTP.Java Vuser, ODBC, SMTP, POP3, Dev web, etc, and Oracle, etc, each protocol has its importance and will be choosing the respective protocol based on the requirements.

If you want to create scripts for web applications will be using HTML/web, and Dev web protocol, if you want to create DB scripts then will be using ODBC/Java Vuser protocol, For communicating with queues then Java Vuser/ Web services. As per requirement will be creating the scripts using the suitable protocol.

In this post, you will learn how to do soap calls in the LoadRunner

In load runner, we have a protocol called “WEB Services”

  • Create a new script with a web service protocol

  • After creating we need to add the below function which will help users for creating soap call
 soap_request

soap_request prototype

soap_request("StepName=",
"ExpectedResponse=AnySoap",
"URL=",
"SOAPEnvelope=",
"Snapshot=t1.inf",
"ResponseParam=", LAST );
  • We are using a simple example like a number conversion soap call as shown below

soap_request("StepName=NumberConversion",
"ExpectedResponse=AnySoap",
"URL=https://www.dataaccess.com/webservicesserver/numberconversion.wso",
"SOAPEnvelope=<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"http://www.dataaccess.com/webservicesserver/\">"
"<soapenv:Header/>"
"<soapenv:Body>"
"<web:NumberToWords>"
"<web:ubiNum>100</web:ubiNum>"
"</web:NumberToWords>"
"</soapenv:Body>"
"</soapenv:Envelope>",
"Snapshot=t1.inf",
"ResponseParam=result", LAST );

  • If we have any headers need to add we need to add your request then we need to add the below code
 web_add_header("Content-Type","text/xml;charset=UTF-8");

Argument for  Soap_request

  • Step name: request name
  • ExpectedResponse: data type expected in response
  • URL: URL for soap request
  • SOAPEnvelope: Actual soap message which will be in XML format
  • Snapshot: it will hold the request and response snapshot in LR
  • ResponseParam: this is a variable where your response to your soap call is saved
  • Last: is the argument that specifies the last argument of the soap_request function

Alternative Way 2:

We have another way to do soap call in Load runner with Web HTTP/ HTML protocol using the web_custom_request function

below is the syntax for web_custom request


web_add_auto_header("Content-Type","text/xml;charset=UTF-8");

web_custom_request("NumberConversion",
"URL=https://www.dataaccess.com/webservicesserver/numberconversion.wso",
"Method=POST",
"Resource=1",
"Snapshot=t2.inf",
"body=<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:web=\"http://www.dataaccess.com/webservicesserver/\"> <soap:Header/><soap:Body><web:NumberToWords><web:ubiNum>100</web:ubiNum></web:NumberToWords></soap:Body></soap:Envelope>"
,LAST);

  • In the above code, XML content should be in a single line to avoid complications and unexpected exceptions while running requests.
  • Web_custom_request is can be used in regular HTTP requests for sending requests to the server with the desired post or getting calls


Hope this will help you, Happy learning.

 

How to do Soap Call Testing in LoadRunner

Leave a Reply

Your email address will not be published. Required fields are marked *