17 Block Scenario Module

This chapter provides a complete listing and reference for the methods in the OpenScript BlockScenariosService Class of BlockScenarios Module Application Programming Interface (API).

17.1 BlockScenariosService API Reference

The following section provides an alphabetical listing of the methods in the OpenScript BlockScenariosService API.

17.1.1 Alphabetical Command Listing

The following table lists the BlockScenariosService API methods in alphabetical order.

Table 17-1 List of BlockScenariosService Methods

Method Description

blockScenarios.run

Run the current VU according to a scenario definition described in a script resource XML file that follows the scenario XML schema.


The following sections provide detailed reference information for each method and enum in the BlockScenariosService Class of BlockScenarios Module Application Programming Interface.


blockScenarios.run

Run the current VU according to a scenario definition described in a script resource XML file that follows the scenario XML schema.

Pre-requisites for using this script:

1. Add all child scripts you want in your scenario using the Assets tab of the script view.

2. Select the Run Scenario node in the tree and edit the scenario file in the details view.

3. In OLT, add 1 instance of this script to your scenario and specify the total number of VUs to run.

4. You can set the simulate flag in Playback Settings if you want the scenario to run in simulation mode.

Format

The blockScenarios.run method has the following command format(s):

blockScenarios.run(scenarioFileRelativeToResources);

Command Parameters

scenarioFileRelativeToResources

a String specifying the relative path to the scenario definition file in XML format.

Throws

Exception

if scenario XML file not found.

Example

Runs the Block Scenario defined in the scenario.xml file.

blockScenarios.run("resources/scenario.xml");