This page is maintained for older versions of Rapise only. The latest documentation can be found at:
Understanding the Script


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

<TestName>.sstest ? the test project file (e.g. MyTest.sstest)

<TestName>.js ? the test script file (e.g. MyTest.js)

<TestName>.objects.js ? the file that contains recorded objects. (e.g. MyTest.objects.js)

<TestName>.user.js ? the file that contains user defined functions. (e.g. MyTest.objects.user.js)

where <TestName> is the name of your Test.


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



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

The Recording tool creates a Rapise Script with three sections:



<TestName>.js: A Test() function

//########## Script Steps ##############

function Test()


  //script logic




<TestName>.js: A list of required libraries: g_load_libraries

g_load_libraries=["Generic"]; // This script will load the Generic library



<TestName>.objects.js A list of learned objects in saved_script_objects.

var saved_script_objects={

  //list of objects used in this script ?



All Scripts must have the above three sections.


Full script

The following functions are also recognized by Rapise and may be present in the test script. Put these functions either in <TestName>.js or <TestName>.user.js.


TestInit() : This function is called once before script playback. It should be used to initialize script-wide data (counters, open datasets, etc).


TestFinish() : This function is called once after test execution. It should be used to release resources (data sets, spreadsheets).  TestFinish() is a good place to post-process Reports.   It may also be used as an integration point with external test management or bug tracking systems.


TestPrepare() : For advanced users; TestPrepare() is called before recording and before playback. It may be used to properly initialize libraries.


See Also

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