REST API Services Testing using loadrunner

REST API Services Testing using loadrunner,rest api services uses web http/html protocol while creating REST API Services scripts using virtual user generator,which is a loadrunner component.Most of the companies are using REST API services in order provide better security in customer data,fast execution for communication between
multiple applications.

Please read Complete Loadrunner Tutorial

REST API Services Testing using loadrunner

In this post we will create REST API Services script in Virtual User Generator i.e VUGen,Please follow below steps to create script for REST API services using VUgen.


2.Which Protocol should use
3.What is the input parameters
4.What is the output Response
5.Content- Type
6.Method – GET,POST,DELETE etc.

ALSO READ  VUGen not recording Script on Chrome Browser

Once you know all above details then it is easy to create the script with the help of below simple syntax ,plesae use below syntax for all rest api services for load testing.


CODE Explanation:

As you see above code i have used web_custom_request() function which is allow users to create custom HTTP request with any useful method(POST,GET,DELETE etc)

1.Card_validation : Request Name

List of Resources:



As based on above resources we will create REST API Services scripting as you see “Method=POST” which is posting the values to database,in case you want to get the details from the database then you can use “Method=GET“.

ALSO READ  Loadrunner Functions


As i have used application/json because content-Type of REST API service is developed with Media Type,as REST API Services has below Media Types,those are


Most of the REST API services are developed with application/json,application/xml and text/xml media types,this one provided by developer.


As i mention in first paragraph REST API service is developed with HTTP protocol for data transfering to multiple systems.While creating the REST API script you need to select
Web-HTTP/HTML protocol.


Body resource which contains input request parameters as i written in above script.The main rest api input request is as below


You can write above input request into below code in order to mention in Body resource.Please check below code.



LAST argument which tells a market which indicates the end of the field list.This total web_custom_request() function returns LR_FAIL(1) or LR_PASS(0) on successful and on failure of web_custom_request()
function execution.

ALSO READ  Parameterization in Loadrunner examples


We can perform Parameterization for input parameters as we mention in Body ,Please read Correlation in loadrunner post,you will get clear idea about manual and automatic correlation for any script whether it could be a web request,rest api or Web-Services.

Thank you for reading,i hope you got good knowledge about REST API Services Testing using loadrunner,please provide your valuable comments and suggestions on this post.


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.