1. Create a Virtual Service
Before running your virtual service (or virtual API) on VirtServer, you need to create the virtual service. You do this in ReadyAPI Virtualization. For detailed information on steps to perform, see Getting Started With ReadyAPI Virtualization.
In this tutorial, you can use a virtual service from Virtualization Sample Project. It is installed along with ReadyAPI and is located in the
<ReadyAPI>\tutorials directory. Open this project in ReadyAPI and expand the APIs (Virtual) node. You will see two virtual services in the Local Virtual Services section of the ReadyAPI Virtualization panel (see the image below).
2. Deploy the Virtual Service
After you created your virtual service (or opened from the file), you can deploy (that is, upload) it to VirtServer:
In ReadyAPI, select the APIs (Virtual) node in the Navigator panel on the left. You will see the VirtServer panel in the central part of the product window:
Select your VirtServer for connection. To do this, click the drop-down arrow and choose the desired VirtServer:
If the Local VirtServer discovery check box is selected, ReadyAPI automatically searches for VirtServers available in your local network.
If this check box is clear, or if VirtServer is absent from the list, click the button and specify your VirtServer working protocol, IP address, and port in the subsequent dialog.
Connect to your VirtServer. To do this, specify the name and password of the user you created on VirtServer on Step 1 of this tutorial, and click Connect:
You will see the virtual services running on selected VirtServer. In our example, there are no services on VirtServer yet:
Drag your virtual service from the Local Virtual Services section at the top of the editor to the VirtServer section:
You will see the service in the VirtServer section:
If you got a NullPointerException error while deploying a virtual service, update your ReadyAPI and VirtServer versions. This issue could happen in versions 1.5.0 or earlier; it was fixed in version 1.6.0.
3. Changing the Virtual Service Port Number
A virtual service uses a certain port. You specify this port in the service properties on the right of the editor (see below).
You may need to change the port number for the virtual service after you deployed it to VirtServer. This is needed if the port you use for the service on your computer is busy on VirtServer by some other virtual service or processes.
To change the port for the virtual service on VirtServer:
Select the virtual service in the VirtServer section of the editor.
Stop the service if you have already run it by accident.
Change the port number in the service properties on the right of the editor, and click Change port. Alternatively, you can click Auto-assign a free port to command VirtServer to select a port for your service automatically:
Now, you are ready to start your virtual service and run tests against it.