Define Test Environment

Applies to ReadyAPI 3.5, last modified on January 19, 2021

You can use Groovy scripts to define which environment is used to run a specific test case. This topic describes how to use a Groovy script to find out if your test case is running as a load test.

Where To Use

There are several ways to run the script below:

Example

The following code demonstrates how to determine if a test case is running in the command line or as a load test:

Groovy

// Checking whether the test runs from the command line.
if( com.eviware.soapui.SoapUI.isCommandLine() )
{
    log.info "This code is executed by the command line in SoapUI"
}

// Checking whether the test runs as a load test.
if( context.LoadTestContext != null )
{
    log.info "This code is executed from a load test"
}

See Also

Handling Events
Groovy Script Test Step
Setup, TearDown, and Report Scripts
Setup And Teardown Scripts
Groovy Scripts
Scripting

Highlight search results