Understanding the Script

Purpose

When you create a new test in Rapise, four files are created:

where <TestName> is the name of your Test.

You can have as many JavaScript files in your test directory as you like, but Main.js is the main test script (unless you specify otherwise in the Settings Dialog). When you record, your interactions are written to Main.js and objects are written to Objects.js when you Playback the test, Main.js is the script that will run.  All Rapise test scripts must have the same basic structure.

Usage

If you are going to modify the script, or create a test script from scratch, you will need to know the test script structure.

Basic Script

Main.js

// Default entry point of the test
function Test()
{
    //script logic
}

// List of loaded libraries. It is automatically populated by the recorder.
g_load_libraries=["Generic"]; // This script will load the Generic library

User.js

//Put your custom functions and variables in this file

Object.js

var saved_script_objects = 
{
   //array of objects used in this script.
};

Full script

The following functions are also recognized by Rapise and may be present in the test script. Put these functions either in Main.js or User.js.

See Also

To specify a different test script, see the Settings Dialog. The test script is specified by Settings > ScriptPath.