Applies to ReadyAPI 2.7, last modified on June 25, 2019

ReadyAPI environments allow you to quickly change the test setup depending on the target environment.

With environments, you can easily switch between different sets of SOAP and REST services, project properties and database connections.

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

You can configure your environments in the Environments editor. To open it, click on the toolbar.

ReadyAPI: The Environments button on the toolbar

Click the image to enlarge it.

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

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

    ReadyAPI: Selecting an environment
  • 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")

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

Creating Environments
Configuring Environments

Highlight search results