Batch Script Basics

 
 
 

Showcase batch scripts must include a class derived from ScriptRunner.ScriptRunner, which contains at least two member methods:

Typically the constructor will simply invoke the base constructor. So a minimal batch script will look like this:

from ScriptRunner import ScriptRunner

# This is the class declaration
class MyBatchScript( ScriptRunner )
    
    # This is the constructor
    def _init_( self, testName, interpreter ):
        # This passes the constructor arguments (supplied from Showcase)
        # to the base class.
        ScriptRunner.__init__( self, testName, interpreter )

    # This is the main entry point of your script. This will be called
    # by Showcase when the script is to be executed.       
    def Main( self ):
        # Typically you will send messages to the base class via
        # the SsendMessage or SendMessageSync commands
        self.sendMessageSync('UI_CONFIRM_DIALOG', ("This is the dialog title", "Hello World!", "Press me"))

# This function is called by Showcase to create an instance of your batch script
# in memory.
def instantiate( testName, interpreter ):
    return MyBatchScript( testName, interpreter )

A batch script will perform custom processing, and send messages to Showcase from its Main function.