Script Prerequisites

Document created by Chris Sommerstad Employee on Jul 22, 2017Last modified by Dave Murphy on Sep 26, 2017
Version 3Show Document
  • View in full screen mode

SOASTA CloudTest scripts are written in JavaScript and a working knowledge of JavaScript programming is required to effectively use them.

 

JavaScript Support


SOASTA CloudTest uses the Mozilla’s "Rhino" embeddable JavaScript language. Since JavaScript is a general language many things not supported declaratively by SOASTA CloudTest are possible via Scripts. Via its scripting support, SOASTA CloudTest’s design also includes the ability to access the underlying message complexity both by the Message Editor and by extension using JavaScript objects. User created test scenarios can be further enhanced by the use of scripts. SOASTA CloudTest provides a simple scripting environment to use JavaScript to traverse and modify the SOASTA CloudTest Object
Model.

 

Scripts can be positioned within Test Clips just like messages and browser actions, and incorporated into Test Compositions one or many times. All test clips, including any Scripts they contain, are reusable.

 

The complete Script API reference is accessible from within CloudTest’s Script Editor. Click Script API on the Script Eidtor toolbar to launch this important documentation resource.

 

 

For step-by-step instructions on how to add your script to a test clip and test composition, see Script.

Regular Expression Support in CloudTest

Regular expressions within CloudTest's user interface (e.g. Session Templates, Include/Exclude of Page Resources, and Property Sets within the Message Editor in the Clip Editor lower panel) are Java expressions. Regular expressions within a script (via the RegExp object or the /pattern/ notation) are JavaScript regular expressions. These regular expression versions differ in important ways (JavaScript’s has less features than Java). The two are not interchangeable, so expressions cannot be copied from a script to an include/exclude for pages, to a session template, or to a PropSet or vice versa.

Java regular Expressions can be built by selection of strings before and after the string to parse within CloudTest session templates via the SubString Parser of the Session Template Package Wizard. Refer to Creating a Regular Expression Using the SubString Parser.

Refer to the Mozilla Regular Expression documentation for more information about regular expressions in JavaScript. Refer to the java.util.regex documentation for details about regular expressions in Java.

Attachments

    Outcomes