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

Use environments to quickly switch to different environments: API endpoints, project properties, database connections, and JMS servers.

Note: Environments can include only project properties. Test suite properties and lower-level properties will not be available.

Create environment

  1. To open the Environments editor, select Configure Environments from a drop-down list on the ReadyAPI toolbar:

    Environments in ReadyAPI: Configure Environments

    Click the image to enlarge it.

  2. In the editor click Add to add an environment:

    ReadyAPI: Creating the first environment

    Click the image to enlarge it.

    Note: If you do not have created environments, click Add Environment.
  3. Specify a name for the new environment.

    ReadyAPI: Creating an environment
  4. Select the setup options you need.

    • Select Empty if you do not want to specify specific options.

    • Select Copy endpoints & credentials from the project if you want to use the project’s endpoints and credentials in the new environment.

  5. Click OK.

In ReadyAPI 1.9 or earlier, using services or interfaces with identical names can cause issues. Please update to ReadyAPI 3.0 to make sure your services have unique identifiers.

Configure environment

To configure environments, select Configure Environments from a drop-down list on the toolbar:

Environments in ReadyAPI: Configure Environments

Click the image to enlarge it.

Change API endpoints, project properties, JDBC connections, and JMS servers for different environments by using the corresponding tabs:

Toolbar

Use the buttons on the Environments editor toolbar to add, remove, or modify environments.

ReadyAPI: The Environments editor toolbar
Icon Option Description
Add Add Adds a new environment.
Remove Remove Deletes the selected environment.
Rename Rename Renames the selected environment.
Clone Clone Creates a copy of the selected environment.
Sort Sort Sorts environments alphabetically.
Note: You can also right-click an environment and select one of the above-mentioned commands.

Switch between environments

To switch between environments, use one of the following commands:

  • Use the drop-down list on the control bar:

    ReadyAPI: Selecting an environment

    Click the image to enlarge it.

  • Double-click an environment in the Environments editor.

  • Right-click an environment in the Environments editor, and select Set Active.

  • Use the <project name>.setActiveEnvironment(<environment name>) code line in the setup or teardown script, or in the Groovy script test step:

    Groovy

    // Replace the project and environment names with those you need

    def proj = testRunner.testCase.project.workspace.getProjectByName("Sample Project")

    proj.setActiveEnvironment("Test Environment")

Set environments in command line runners

You can also force ReadyAPI to switch the environment while running tests with the SoapUI test runner, LoadUI test runner, or security test runner:

  • In GUI – On the Overrides tab, select the environment you need in the Environments drop-down list.

    Note: If you need to override the Endpoint, Username, and Password values, do this with the -e, -u, and -p command-line arguments. See Command-Line Arguments for details.
  • In command line – Specify the environment you need by using the -E argument, for example:

    "-ETest Environment"

See Also

Testing APIs
Starting ReadyAPI Tests by Using Command-Line Runners

Highlight search results