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"); }
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();
}
public LoadGenerator currentLG ;
The Load Generator executing the current Virtual User.
public VirtualUser currentVU ;
The Virtual User currently running.
public VariableManager variableManager ;
The VariableManager
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.
public void fail(String message);
Parameters
message Mark the current script as failed and stops the execution of the script. The specified message will be logged at ERROR level.
public void fail(String errorCode,String message);
Parameters
errorCode message Mark the current script as failed and stops the execution of the script. The specified message will be logged at ERROR level.
public long getElapsedTime();
Parameters
return Returns the elapsed time in milliseconds since the test started.
public String getTestStatus();
Parameters
return Returns the current status of the test. The test state can be "RUNNING" or "STOPPING".