T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1

com.tplan.robot.scripting
Interface JavaTestScript

All Known Implementing Classes:
AbstractJavaTestScript, DefaultJavaTestScript

public interface JavaTestScript

Java test script interface. Objects implementing this interface may get plugged into an automated testing thread through the ApplicationSupport.createAutomatedRunnable(com.tplan.robot.scripting.JavaTestScript, java.lang.String, java.lang.String[], java.io.PrintStream, boolean) method and get their test() method executed when user invokes the appropriate action in the T-Plan Robot Enterprise GUI or starts the associated automated test thread programatically from a Java program.


T-Plan Robot Enterprise, (C) 2009-2019 T-Plan Limited. All rights reserved.


Method Summary
 void setContext(ScriptingContext context)
          Set context.
 void setInterpret(TestScriptInterpret interpret)
          Associate a test script interpret with this Java test script.
 void test()
          Test method with the test script code.
 

Method Detail

test

void test()
Test method with the test script code. It will be executed when user selects the "Execute" action in the GUI (through a tool bar button or menu item) or if the automated testing thread containing this test script gets started programatically.`


setContext

void setContext(ScriptingContext context)

Set context. Scripting context is a map holding various objects and structures which may be needed for script compilation and execution. A new context instance is passed to this test class before every execution (i.e. before the test() method is called). Context instances are typically created by ScriptManager.

Parameters:
context - a context instance.

setInterpret

void setInterpret(TestScriptInterpret interpret)

Associate a test script interpret with this Java test script. This method will be called just once shortly after this test script gets plugged into an automated test thread through the ApplicationSupport.createAutomatedRunnable(com.tplan.robot.scripting.JavaTestScript, java.lang.String, java.lang.String[], java.io.PrintStream, boolean) method. Object implementing this interface are recommended to save a reference to the interpret in the method body and use it to access objects from the execution context and/or register for script or command events.

Parameters:
interpret - instance of TestScriptInterpret which will interpret the code and control execution of this script.

T-Plan Robot Enterprise 5.0.1
Build No. 5.0.1-20190308.1