Share this page

# Run logic view

The runtime settings Run Logic view enables you to set the order in which actions run during a test.

In this topic:

## Configure run logic

In the Run Logic view, you can define the order and frequency for running script actions during a test. Not all actions that are defined in the script need to be included, so you can build the run logic for the test run without changing the actual code.

Using the run logic tree structure, you can add multiple actions, group the actions into blocks, and define the logic for how the blocks are run. You perform these actions in the default sections of your script: initialize, run (actions), and finalize). For details on script structure, see Vuser script sections.

When an item in the tree is selected, you can right-click and use the context menu for each item to insert, delete, and move items as relevant, as well as use cut, copy, and paste functions.

Unnamed actions: Unnamed (anonymous) actions do not have a name argument supplied in the action definition in the script, and they cannot be added to the run logic. A warning message is displayed if your script contains unnamed actions. If you want to these actions to be included, add name arguments for them in the script

## Run Logic view options

The Run Logic view can includes the options and functions described below. The specific fields included vary, according to the protocol type.

UI element | Description
--- | ---
Number of iterations | The number of times the entire run block (within the run logic tree) is repeated during the test run. When you change the value in the field, it also changes the number next to the run block.
Enable run logic during replay | Use the check box to switch the run logic on or off. When selected, the defined run logic order is used when executing the script. Note: If run logic is not enabled, the actions in the script are run in the same order that they are loaded by the JavaScript parser. This is similar to, but not identical to, their order in the script code.
Automatic fill | Use the button to automatically populate the run logic tree with all the all non-anonymous actions in the script. This overwrites the current tree configuration.
Insert | Enables you to add items to the tree: Select a block or action in the tree. Click Insert. Select an item from the displayed dropdown list. The list contains the actions are relevant for the selected block, and Block if it is permitted to add a block at that location in the tree.
Delete | Immediately deletes the currently selected item, and all child items.
Move Up/Move Down | Moves the selected item up or down within its block.
initialize block | This is a predefined block that is executed once only, at the beginning of the test. It is mostly used for initial business processes such as enter domain and login page. Included actions always run sequentially. For some protocols, you cannot define child blocks for the initialize block
run block | This is a predefined block that controls the run logic for the main business process that you want to test. The run block can contain multiple actions, and multiple blocks of actions. It can be run multiple times, according to the number of iterations that you set at the top of the view. The number of iterations is shown to the right of the block name.
finalize block | This is a predefined block that is executed once only, at the end of the test. It can be used for business processes such as logout. Included actions always run sequentially. For some protocols, you cannot define child blocks for the finalize block.
<Block run logic> | You can define the logic used to run the blocks within the run block, or each set of actions in a block: - Sequential - All items in the block run in the order they appear (default). - Random - An item in the block is picked at random each run of the block, and only that item (action or block) is executed. The probability for an item being picked is weighted by its run percentage (see Run percentage, below). - Shuffle - Run all items in the block, but in a random order. (Not available for some protocols.)
Loops | The number of times to run each block.
<Run percentage> | The percentage of times to run this item, within a block that is set to use random run logic. Random run logic requires a percentage probability value for each item in the block, so that the total probability for all items adds up to 100%. Items with a higher probability are picked more often. Any item with 0% will not participate in the run. By default, the percentage values are divided evenly between the items. Click in a percentage box to change the value. If the total percentages do not add up to 100%, the block is shown in error. In this situation, when you save the runtime settings, the percentage for the first item in the block is automatically adjusted so that the total is 100%. If you change the run logic from Random to another logic, your changes to the default percentage values are not saved. If you reset to Random, the default percentages are used. Example: In the following example, during the 4 iterations, Block1 and Block2 will run with a probability of 70% and 30% respectively, but not necessarily 7 and 3 times. Block1 actions will run with a probability of 60% and 40% respectively.

## See also

- Configure runtime settings

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1-26.3 All View Local Help Center View Online Help Center Version: