When adding or editing a step, change the action type to Execute Script. This action has a single datasource, which contains the script. Press the datasource edit button to edit the script.
The script will be pre-populated with a simple example and a little documentation to help you get started.
We find real examples to be more helpful than pages of verbiage, so we’ll maintain a list of scripts that we’ve found useful for your reference:
The scripting environment gives the tester a lot of power. Including the ability to hang the virtual user in a loop, consume all the available memory, and maybe even crash Load Tester. Please be careful!
Load Tester needs to know what DataSets are used by the testcase – which means that it needs to know what DataSets are used by each step. This is needed to distribute the right DataSets to the load engines. Under normal use, this is completely seamless. But because a script could reference a DataSet in a way that Load Tester cannot detect, the required DataSets must be explicitly declared.
To do this, implement the getDatasetsRequired() method. If no DataSets are used by the script, the getDatasetsRequired() function can be omitted or return null. Otherwise the function should return the name of the required DataSet (or an array of names) used by the script. This will ensure that the correct DataSets are sent to the load engines, but it does NOT support automatic renaming of DataSets. The scripts must be updated manually.