How to Use Service Virtualization when Designing Scenarios

You configure your test to work with virtualized services, using the HP Service Virtualization Setup Dialog Box, accessible from the Design tab of a Manual or Goal-Oriented scenario.

The add a virtual service to your scenario, follow the procedures below.

  1. Prepare the environment

    • If your script requires the service to be running while you record your business process, open Service Virtualization and start the virtualized service before recording.
    • Update any configuration files or code that refer to the service. There are two scenarios in which you may need to instruct your application to use the virtualized service in place of the actual one:

    1. Application components that use the service are embedded in the code or in a configuration file. In this case, you will need to update the code in your application or update the configuration file to point to the new URL.

      For example,

      • a .NET Desktop application that calls a Web service, whose URL is set using a constant: stringURL = http://hpe.com.
      • a service or back-end component uses the Web service and the URL is configured in the app.config file.
    2. Services that are consumed by accessing UDDI or another registry component (Systinet) and the URL is retrieved during runtime. In this case, you will need to update the end point URL in UDDI/Systinet.
  2. Create a load test in the Controller

    1. In the Design tab, click the Service Virtualization button .
    2. In the HP Service Virtualization Setup Dialog Box, click the Add Services button.
    3. In the Add New Services dialog box select the source from which to load the services—Project or Running Server.
    4. For a Project, browse for the project containing the simulated services you want to run with your load test.
      For a Running Server, specify the URL of the server hosting HP Service Virtualization. Click Next.

      Note: A service that you add from a running server cannot be deployed; you can however, switch between modes. To deploy a virtualized service, you need to specify its project file. Once the project is loaded, LoadRunner is able to deploy all of the services belonging to that project.

      If your project or service requires authentication or decryption, you will be prompted to provide the details. Click Next. Wait for the services to be displayed in the HP Service Virtualization Setup dialog box.

    5. In the list of services, click the check boxes adjacent to the services you want to run.
    6. For each selected service, select the relevant Data model and Performance model to associate with the virtual service.
    7. Click the <project name> link, and verify that the address of the virtualization server is correct. If necessary, you can change the address of the simulation server.
    8. Manually set a status, or use the Standy-By or Simulation links to set the service mode:

      indicates the service is being simulated.

      indicates the service is on Stand-By.

  3. Run a load test In the Controller

    Run the scenario in the normal way.

    In the Controller's Run tab, view the Scenario Status pane and click the ON or OFF link in the Service Virtualization status row, to open the HP Service Virtualization Runtime Dialog Box.

    Select one or more services and use the toolbar links to control the service: Simulate, Stop, Unlock, Undeploy, etc.

  4. Add a project to your running load test

    To add or update a service during your load test, go back to the Design tab and add a new service as described above, using the HP Service Virtualization Setup Dialog Box.

  5. View Online Monitors

    For details, see Service Virtualization Monitors.

    Note: If you intend to use the monitor credentials together with SSL credentials, the security policy may prevent the project from being added to Controller. To overcome this issue, add the SV Operators group to Performance Monitor Users.

Back to top