Actions

Top  Previous  Next

Purpose

Actions are anything the user can do to a GUI control, such as click, select, fill with text, etc.  You can override the behavior of an action, without creating or altering a Recording Library, using SeSExtendAction(). Overriding an action affects Playback, but not Recording.

 

Usage

SeSExtendAction() is used to override an action handler or add a new DoAction handler:

 

function SeSExtendAction(objectTypedoActionNamereplacementFunction

 

where:

 

objectType is the name or regular expression specifying the object type(s) for which this extension should apply.
doActionName is the name or regular expression specifying the DoAction handler that should be overridden.
replacementFunction is the function containing overriding behavior.

 

In most cases SeSExtendAction() should be called from within TestInit().

 

Calling Base Actions

The function you are overriding is called the BaseAction.  You can call it like this:

 

this.BaseAction(arguments);

 

You may override actions several times. For example:

 

function DoActionB()

{

       this.BaseAction();

}

 

function DoActionC()

{

       this.BaseAction();

}

 

SeSExtendAction("Win32Button", "DoAction", DoActionB);

SeSExtendAction("Win32Button", "DoAction", DoActionC);

 

When DoAction is called for the Win32Button, the following sequence is executed:

 

DoActionC->DoActionB->DoAction

 

See Also

To see what actions can be extended, look in SeSBehavior.js (in the SmarteStudio Engine).