Skip to content

Custom Libraries

Purpose

If your application doesn't work with the predefined Recording Libraries, you can create your own.

Usage

Your library can provide Basic, Advanced or Full support for your application.  Basic support allows you to define a global object with common functionality. Advanced allows enables Learn of application-specific object types, write test scripts, and Playback your scripts. Full support allows you to Record as well.

Create your library via Create... > User Lib... menu.

create lib

Basic Support

Define one or many application-specific Global Objects.

Advanced Support

Add a Matcher Rule to the library for every object type in your application. The SeSMatcherRule includes information to identify the object and a set of behaviors.

var *yourApplicationRule* = new SeSMatcherRule(
{
    object_type: "*yourAppObject*",
    classname: "*yourAppFrame*", //You can use a [regular expression](regular_expressions.md) here
    behavior: [*yourAppBehavior*]
})

Override Actions: Override actions in yourAppBehavior (above). The action definitions you provides will be used during Playback. Overriding actions does not affect recording.

var HTMLFirefoxBehavior =
{
    actions: [{
        actionName: "Click",
        DoAction: function(){}
    },
    {
        actionName: "SetText",
        DoAction: function(/**string*/ txt){}
    }]
 }

Full Support

Enable Recording:  You can enable recording in two ways. If your application notifies the Accessibility Events interface about application events, you can override events in the behavior section of SeSMatcherRules:

var newBehavior = {
    actions: [{/*section deleted for brevity*/}],
    events:
    {
        OnSelect: function(/**SeSObject*/ param, /*boolean*/ badd)
        {
            /*...*/
        },
        OnSelectAdd: function(/**SeSObject*/ param, /**boolean*/ badd)
        {
            /*...*/
        }
     }
}

var newRule = new SeSMatcherRule({
    object_type: "someType",
    role: "someRole",
    behavior: [newBehavior],
 })

Otherwise, you will have to implement Custom Recording.

Custom Recording: With custom recording, it is the library's responsibility to:

  • detect user actions in the application, and
  • call RegisterAction() (which writes the action to the script).

See Also