Over a million developers have joined DZone.

Testing Rest APIs in HPE LoadRunner

DZone's Guide to

Testing Rest APIs in HPE LoadRunner

In this article we are going to learn about how to test REST APIs in LoadRunner.

Free Resource

Transform incident management with machine learning and analytics to help you maintain optimal performance and availability while keeping pace with the growing demands of digital business with this eBook, brought to you in partnership with BMC.

In this article, we are going to learn about how to test REST APIs in LoadRunner. REST APIs is a trend in creating versatile applications. REST stands for Representational State Transfer. You can learn more about REST on this wiki page. This blog article focuses on testing REST APIs in HPE LoadRunner.

If you noticed any auto insurance quote website, after selecting your car year, immediately you can see the appropriate make list. Similarly, once you select the make, the appropriate model will get listed. Please see below screen.

If you select 2016 as year, request will be sent with the parameter ‘year’ and the response will have all the makes of the year 2016. Similarly, if you select the make, appropriate models list will be returned. We will see how to add REST API calls in the HPE LoadRunner script.

Sample REST Call Testing REST APIs in HPE LoadRunner

Sample REST Call

How to Insert REST APIs Request in HPE LoadRunner?

Follow the below steps in Web HTTP/HTML protocol. I am using HPE LoadRunner 12.53 version on my laptop.

  1. Go to Design > Insert in Script > REST API or press Ctrl + Shift + W
REST API in LoadRunner

REST API in LoadRunner

2. You will get REST Step Properties dialog box as shown below

REST Step Properties

REST Step Properties

3. In this example, we are going to use sample REST API http://jsonplaceholder.typicode.com/posts/1. Just sending the URL will not work, you need to add the header as shown below.



Below is the valid response for the call.

REST GET Call Response

REST GET Call Response

Below is the sample POST call details.



POST call output.

REST POST Call Response

REST POST Call Response

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

apis ,properties ,list ,rest ,protocol ,transfer ,loadrunner ,api ,hpe ,rest apis

Published at DZone with permission of NaveenKumar Namachivayam, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}