+

Search Tips   |   Advanced Search

Class RuntimeContext

This class represents the execution context of the script.

It is accessible from the pre-defined variable: "context" and should not be created directly.

Example:

 var myvar = context.variableManager.getValue("myvar"); if (myvar==null) { context.fail("Variable 'myvar' is not defined"); }

Synopsis

 public class RuntimeContext {
  // Public Fields
  public LoadGenerator currentLG ;
  public VirtualUser currentVU ;
  public VariableManager variableManager ;
  // Public Methods
  public void fail();
  public void fail(String message);
  public void fail(String errorCode,
                   String message);
  public long getElapsedTime();
  public String getTestStatus();
}

currentLG

public LoadGenerator currentLG ;

The Load Generator executing the current Virtual User.

currentVU

public VirtualUser currentVU ;

The Virtual User currently running.

variableManager

public VariableManager variableManager ;

The VariableManager

fail()

public void fail();

Mark the current script as failed and stops the execution of the script. A default error message will be logged at ERROR level.

fail(String)

public void fail(String message);

Parameters

Mark the current script as failed and stops the execution of the script. The specified message will be logged at ERROR level.

fail(String, String)

public void fail(String errorCode,
                 String message);

Parameters

Mark the current script as failed and stops the execution of the script. The specified message will be logged at ERROR level.

getElapsedTime()

public long getElapsedTime();

Parameters

Returns the elapsed time in milliseconds since the test started.

getTestStatus()

public String getTestStatus();

Parameters

Returns the current status of the test. The test state can be "RUNNING" or "STOPPING".


Home