Applies to ReadyAPI 3.3.2, last modified on September 18, 2020

When ReadyAPI runs, it passes a number of parameters to the Java virtual machine to prepare the environment. You can modify these parameters according to your needs.

Setting Command Line and JVM Options

Depending on how you run ReadyAPI, it passes the parameters from different locations:

Running ReadyAPI via... Passes parameters from...
Executable The helper .vmoptions file.
Command line The .bat/.sh script.

For the description of the JVM parameters, see Java Virtual Machine Parameters.

Running ReadyAPI via Executable

The ReadyAPI installer creates a *.vmoptions file that contains default arguments for the Java virtual machine. Here is a sample snippet of that file:

-Xms128m
-Xmx4096m
-Dsoapui.properties=soapui.properties
-Dgroovy.source.encoding=iso-8859-1
...

Open this file with any text editor and modify any parameter that you need. If the parameter is absent, you can add it.

The last line in the .vmoptions file must be followed by a new line.

Running ReadyAPI via Command Line

When you use the .bat or .sh file to run ReadyAPI, the Java virtual machine uses parameters specified in the script file. These parameters are stored in the JAVA_OPTS variable.

When the script calls Java, it passes the specified parameters as command-line arguments. You can find the desired parameter and modify it according to your needs. If the parameter is absent, you can add it.

Here is how variables look like in script files:

  • In the .bat file:

    set JAVA_OPTS=-Xms128m -Xmx%READY_XMX% -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:MaxPermSize=256m -Dsoapui.properties=soapui.properties
  • In the .sh file:

    JAVA_OPTS="-Xms128m -Xmx$READY_XMX -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:MaxPermSize=256m -Dsoapui.properties=soapui.properties
Note: In the same way, you can modify memory settings of the command-line runners (testrunner.bat/.sh, loadtestrunner.bat/.sh, and so on).

Adding New Parameters

To append a new parameter to the already specified parameters, specify the JAVA_OPTS variable itself before specifying the desired parameter. For example:

  • In the .bat file:

    set JAVA_OPTS=%JAVA_OPTS% -Dsoapui.browser.disabled="true"
  • In the .sh file:

    JAVA_OPTS="$JAVA_OPTS -Dsoapui.browser.disabled=true"

Specifying Properties via Command Line

Using command-line arguments, you can modify system and global properties.

To specify system properties, use the -D argument:

-Dproperty.name=value

To specify global properties, use the -G argument:

-Gproperty_name=value

Also, you can load a list of properties from a file. To do this, use the following argument:

-Dsoapui.properties=file name

Note: The file name is a path to a file that contains properties to load.

By using command-line arguments, you can specify properties of a specific project, test suite, test case or virtual service. To do this, use the following pattern:

-Dsoapui.properties.testitem=file name
  • testitem – The name of the desired test item with spaces removed.

  • file name – The path to the file that contains the list of properties.

For example, to specify properties for “TestSuite 1”, use the following line:

-Dsoapui.properties.TestSuite1=testsuite1.properties

This will affect any test item the name of which matches this pattern. For example, the argument above will also affect test items with names “Test Suite 1”, “Test Suite1” or “T est S uite 1”, and so on.

See Also

Java Virtual Machine Parameters
JVM Settings

Highlight search results