You use VirtRunner to run virtual APIs (virtual services) from a command line. You can find the file in the <ReadyAPI directory>\bin folder. The file name is virtrunner.bat on Windows, and virtrunner.sh on Linux and Mac.
To use VirtRunner, you need the ReadyAPI Virtualization license.
The runner’s command line has the following format:
Running Multiple Virtual Services
If you are going to run multiple virtual services, make sure they have different ports or paths. You can specify a port and path for your virtual service in its properties. Also, use the -m command-line argument to specify the port and path your virtual service will use during the run.
The fully qualified path to the project that contains the virtual services to be run. If the file name or path includes spaces, enclose the entire argument in quotes.
Commands the runner to disable blocking. This is required if you are going to run VirtRunner with the
nohup command on Linux or as a service on Windows.
Specifies a value of a system property for the test run. The specified value will override the variable’s value during the run.
-D<variable>=<value>. If the value includes spaces, enclose the entire argument in quotes. To override several variable values, specify the
-D argument several times.
Specifies the root directory, to which the runner will export results of the virtual service.
Specifies a value of a global property for the test run. The specified value will override the variable’s value during the run.
-G<variable>=<value>. If the value includes spaces, enclose the entire argument in quotes. To override several variable values, specify the
-G argument several times.
Specify a virtual service for the run. Use the following syntax:
virt-name – The name of the virtual service to start. Specify the name as it is shown in the virtual service editor. If the name includes spaces, enclose it in quotes (see an example below).
port – Optional. The port the virtual service will use during the run. This parameter overrides the port number specified in properties of the virtual service.
If your project contains several REST or SOAP virtual services using the same port, specify different paths for them.
If there is a JDBC or TCP virtual service sharing a port number with any virtual service, neither of them will start.
path – Optional. The “path” part of the service’s URL. This option overrides the path specified by the service’s properties. The path must start with a slash –
To run several virtual services, separate them with commas:
-m<virt1:port1:path1>,<virt2:port2:path2>,… (see an example below).
If you do not use the
-m argument, the runner will start all the virtual services from your project. The runner will use the ports and paths that properties of these virtual services specify.
Commands the runner to open generated coverage reports in your default browser.
|This argument is significant only if you also use the
Specifies a value of a project property for the test run. The specified value will override the property’s value during the run. Typically, it is used to override custom properties.
-P<variable>=<value>. If the value includes spaces, enclose the entire argument in quotes. To override several variable values, specify the
-P argument several times.
Commands the runner to save the project after the virtual service run is over. This may be useful if your service stores data to the project during the run.
Specifies the workspace settings to use during the virtual service run. By default, these settings are stored in the <User directory>/.readyapi/readyapi‑settings.xml file. This argument allows you to specify another settings file for the run. It may be useful to use different proxy, SSL, HTTP and other settings without changing them in ReadyAPI.
Specifies the password for your settings file.
Specifies the project password if the project is encrypted.
The following command runs all the virtual services in the specified project:
- The following command runs two virtual services from the specified project:
- The The First Service virtual service that uses the 8081 port and the /service-a path.
- The SecondService virtual service that uses the 8082 port and the /service-b path.
virtrunner.bat -m"The First Service":8081:/service-a,SecondService:8082:/service-b "C:\Projects\my-project.xml"