Performance Testing

How to test a RESTful web service using HP’s LoadRunner

By Test Guild
  • Share:
Join the Guild for FREE
API Testing Tools

Need to test a RESTful webservice using LoadRunner, but aren't sure if LoadRunner supports RESTFul? Did you try using the Web Services protocol without any luck? Actually, LoadRunner does support RESTful web services using the HTTP/HTML protocol with the web_url function.

Using web_url

REST is a very simple technology that uses XML for communication combined with URL patters. Also RESTFul web services work with most HTTP methods that many services expose. For example:

  • GET is used to perform a query or to obtain data. The data returned from the web service is a representation of the request info.
  • POST can be used to create a new resource. Typically, a web service will respond with data or a status of success or failure.

(For more detail check out this Oracle article on RESTful Web Services)

Using LoadRunners's web_url allows you to GET a request from a RESTFul service using its URL argument.

Using LoadRunner to test a RESTful example

  • For this example, I'll use the Sample Flight Application that comes with Service Test 11.20

  • I'm using the REST URL for my server plus the web service operations with its DepartureCity and ArrivalCity parameters/values. In LoadRunner add a web_url function with the following values:

  • Next, bring up the Run-time Settings enable the Extended Log with all its options:

  • Run the script should return the response from the RESTful service. Your LR's Replay log should contain the response body for the Flights operation:

Modify LoadRunner script

If you wanted to capture the first FlightNumber returned, you would use the same method you would normally use with the web_reg_save_param. The full script should look like this:




lr_output_message(“This is the first flightnumber %s”,lr_eval_string(“{CheckFlightNum}”));
return 0;

Be Restful with LoadRunner!!

To see how to test a NON-RESTful web service using LoadRunner check out my post How to test a web service using HP's LoadRunner

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

15 Top Load Testing Software / Tools for 2023 (Open Source Guide)

Posted on 03/12/2023

In the world of software development, testing is vital. No matter how well ...

What is Throughput in Performance Testing?

Posted on 08/16/2022

Throughput is one of the most misunderstood performance testing concepts new testers sometimes ...

Performance Testing Guide: Overview, Common Problems, and Tools

Posted on 06/07/2022

Performance matters, especially if you want to produce quality software. For this reason, ...