Virtual services in load testing with the HP LoadRunner and HP Service Virtualization integration

This post was written by Sergey Kutsos and Andrey Gaevskiy from the LoadRunner R&D team

 

Imagine you’re a performance testing engineer who has to test a composite application which relies on a number of business services; some are developed in-house and some are third-party services. You find out that one of the in-house services doesn’t work, and you also discover that you’re not allowed to perform load testing on one of the third-party services because it’s a production service. How can you go ahead with your performance testing, when there are key services that you can’t access?

 

The answer is to simulate these services with HP Service Virtualization. This powerful tool helps you create a virtual version of the services by learning how the real service responds to requests that it receives.  If the real service isn’t available, you can create responses based on the service’s interface description—for example, a WSDL file. You can then substitute the unavailable services with the virtual services and continue working as usual.  Whenever a request is sent to the unavailable service, the virtual service will respond instead.  You can configure different sets of responses (‘data models’) to use in different situations, and you can also control the performance of the virtual service, by delaying or speeding up the response time (‘performance models’).

 

To make this even easier, HP Service Virtualization has been integrated with HP LoadRunner.  The integration helps in the following situations:

  • When you need to complete a business process during a load test, but can’t because services aren’t available for some reason
  • When you’re developing a load test that needs the service during development of the VuGen script
  • When you need to understand how your application behaves when the response time of the service is unusually slow or fast
  • When you analyze the test results, you need to know how the simulation behaved. The integration provides this information.

 

This diagram shows how it all works:

LRArchitecture.png

 

The Controller instructs the Load Generators to generate load on the application under test (AUT). With the integration, the Controller can also contact the HP Service Virtualization simulation server and instruct it to simulate specific services—and even tell it which data and performance models to use.

 

Here’s how to perform a load test against the AUT with a virtualized service:

 

1. Create a virtual service in HP Service Virtualization

 

One way to create a Web Service simulation on Service Virtualization server is to import its WSDL file. You can then define sets of requests and their corresponding responses according to the schemas defined in the WSDL (the data models), and configure the performance models. This screenshot shows a service in stand-by mode, with the data and performance models available:

SV.png

 

2. Create a VuGen script

If your script requires the service to be running while you record your business process, you can open HP Service Virtualization simultaneously and deploy the virtualized service. Then you record the script as usual.

 

3. Create a Load Test Scenario in the Controller

- Create a scenario as usual, define Virtual User groups, scheduler, etc

- In the Design tab, click the Service Virtualization button:

menu.png

- In the Service Virtualization dialog box click Add Project.

- In the Add Project dialog box, locate the relevant project containing the services you want to simulate in your load test.

- Click on Simulate checkbox to activate the added service.

- For each service you choose to simulate, select the appropriate Data model and Performance model to associate with the virtual service:

dlg.png

 

- In the Simulation Server cell for the selected service, verify that the address of the simulation server is correct. If necessary, you can change the address of the simulation server.

- Click the Deploy Project button to deploy the services on your Service Virtualization server.

Servers security allows you to define security credentials to access your  Service Virtualization server if necessary (the  Service Virtualization server installation allows you to choose whether to install with security credentials or not)

 

Note. The virtual service must be loaded on the simulation server to be able to deploy the service as part of your load test in the Controller.

 

4. Run a Load Test in the Controller

 

You can stop, start, or load a new Service Virtualization project while your load test runs. To update services during the run, open the Service Virtualization dialog box as follows:

 

- In the Run tab, in the Scenario Status pane, click the status (ON or OFF) link of the Service Virtualization line to open the Service Virtualization dialog box:

status.png

 

- In the Service Virtualization dialog box, select the Simulate check box of the service you want to stop or start.

- Click Add Project to load the project containing the virtualized services to run with your load test.

- Update Data or /and Performance Model to change it “on the fly”.

 

Note. If you change the Data Model or the Performance Model during a load test, the Service Virtualization server will be restarted, so some errors might appear in the Controller’s Output while it is restarting.

 

During a load test you can invoke two Service Virtualization online graphs from the Available Graphs list:

graphs.png

 

5. Open results in Analysis

 

When the scenario is finished, you can open the results in LoadRunner’s Analysis module. In addition to the regular graphs, two Service Virtualization graphs will be available:

new graph.png

 

These graphs behave just like the other graphs available in the Analysis module.

 

Leave us a comment in the box below to let us know if you’re using Service Virtualization, or if you have any feedback on this article.

 

Thanks to Sergey and Andrey for providing this post!

 

SV-Webinar.png

Comments
Richard_Bishop | ‎07-08-2013 12:09 PM

Great blog article, thanks for sharing.

Would either of you be interested in doing this as a webinar for the Vivit user group? We're always on the look out for good content and this is a great add-on product to help testers early in the SLDC when services aren't available or to enable testing when part of the test environment isn't up and running.

| ‎07-09-2013 12:01 AM

Hi Richard,

 

Thanks for your interest.  Please contact me  by email (malcolm.isaacs@hp.com) so we can discuss this.  

 

NaveenKumar N(anon) | ‎07-09-2013 03:40 AM

Great Article! Thanks!

| ‎07-10-2013 12:27 AM

Vivit hosted a Webinar in March, with Ferhan Kilical, HP's Product Marketing Manager for Service Virtualization, and Mirek Novotny, HP's Product Manager for Service Virtualization.

 

Hop over to http://www.vivit-worldwide.org/?page=32013PerfTest to see it!

Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
Search
Showing results for 
Search instead for 
Do you mean 
About the Author
Malcolm is a functional architect, focusing on best practices and methodologies across the software development lifecycle.
Featured


Follow Us
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.