Applies to ReadyAPI 3.0, last modified on November 15, 2019

Quite often, developers and QA engineers create virtual APIs on their computers, but run them on a remote machine, typically, on some server in a local network. This approach lets you decrease the workload on the computers, where you create virtual APIs (virtual services), and it is helpful should the virtual API be available 24×7.

To run a virtual service on a remote computer, use VirtServer – a server-side tool specifically designed for running virtual APIs. VirtServer effectively runs multiple virtual APIs, supports the remote control and administering, and allows multi-user access to virtual services.

This topic explains how to run virtual services on remote machines with VirtServer.

Requirements

VirtServer requires a separate license. To use VirtServer from ReadyAPI, you need a ServiceV Pro license. If you do not have it, request it on our website.

A possible alternative is to save your virtual services to a Web application archive file and run this file on a Tomcat or another servlet container. See Deploying Virtual Service In WAR Format.

Running From ServiceV Project Editor

To run virtual services on VirtServer, you need to perform the following actions:

  1. Install VirtServer on a remote computer and activate its license there. Run VirtServer and create a user account in it.

  2. Deploy your virtual service to a remote machine. If needed, change the port that the service will use on VirtServer after the deployment (it is possible that VirtServer has another virtual API that is using the same port).

  3. Run the virtual service and test it.

See VirtServer Tutorial for a step-by-step description.

Note that you can perform steps 2 and 3 in ReadyAPI from your ServiceV project editor:

Service virtualization and API testing: Running a virtual service on VirtServer

VirtServer 3.0 introduces new security settings.

If VirtServer’s compatibility mode is turned off, you cannot connect to it by using ServiceV prior to 3.0. Update your ReadyAPI installation or ask your VirtServer administrators to turn on the compatibility mode.

Running From VirtServer Web Interface

You can also run a virtual service on VirtServer through the VirtServer web interface:

  1. Open the VirtServer web interface in a browser. The URL to use looks like this –

    https://virtserver-ip-or-name:9090/virtserver

    Port 9090 is used by default.

  2. Log in to VirtServer, and then click the button in the Status column for your service:

    Service virtualization and API testing: Running virtual services from VirtServer UI

    Click the image to enlarge it.

    Note that the virtual service must already be on the VirtServer computer.

You cannot deploy virtual services by using the web interface of VirtServer, you can only manage them.

Running From Client-Side Command Line

ReadyAPI includes a virtserver-cli.bat command-line utility. You run it on your client computer and use it to deploy virtual services to the remote VirtServer, and to start, stop and perform other actions with virtual services on that remote VirtServer. For complete information on the utility and its command-line arguments, see VirtServer – Command-Line Interface Utility.

Running From Test Case

You can start virtual services on a VirtServer computer from your SoapUI functional tests. To do this:

  1. Add the Virtual Service Runner test step to the beginning of your test case. It will run before any request is sent to the virtual service.

  2. Specify the VirtServer address in the step properties and the virtual service to be run:

    Service virtualization and API testing: Using the Virtual Service Runner test step to running virtual service on VirtServer

    Click the image to enlarge it.

    Note: As you can see, the Virtual Service Runner test step can also stop virtual services. That is, you can call it at the end of your tests to stop virtual services, if they are not needed.

For more information on automation of virtual service runs, see About Automating Virtual Service Runs.

See Also

Running Virtual Services
Deploying Virtual Service In WAR Format

Highlight search results