The following line of code placed into a Script (and subsequently a Test Composition) provides a quick sense of the power of SOASTA CloudTest pre-defined variables, as well as of the special status of the Result object within the object model:
$context.result.postMessage($context.result.LEVEL_INFO, "hello, world");
$context.result.postMessage($context.result.LEVEL_INFO, "hello", "world");
The first line of code posts a text string to the result object for the current composition. The second line posts the same string as well as a detail message about the execution of that line as shown below.
Results are accessed via Central > Recently Played and include a variety of informational postings about played Test Compositions).
Note: Use the following links to download and import the XML for the entire Hello World Composition or just the Hello World Script Code. XML can be imported using the SOASTA CloudTest > Repository toolbar > Import icon. Refer to Script to learn how to add a script to a test clip and test composition.
SOASTA CloudTest also includes the constants
LEVEL_ERROR. For example,
$context.result.postMessage($context.result.LEVEL_VERBOSE, "hello, world [as 'verbose']");$context.result.postMessage($context.result.LEVEL_STATISTICS, "hello, world [as 'statistics']");
$context.result.postMessage($context.result.LEVEL_ERROR, "hello, world [as 'error']");