Share this page

# Insert and modify loops

Loops repeat selected portions of the script until certain criteria is met or for a specified number of iterations. You can insert loops and loop modifiers from the Flow control section of the Steps box (available by clicking the Add Step button in the toolbar).

In this topic:

## For loops

For loops perform the steps surrounded by the loop until the end condition is met or the code reaches a break statement. Loops arguments use JavaScript syntax. To insert a for loop, click the Add Step button , select Flow Control and drag For Loop to the required location in the script.

Back to top

## Break statements

Break statements indicate that the current loop should end immediately. For example, if a break statement is encountered in the second of five iteration in a for loop, the loop will end immediately without completing the remaining iterations. To insert a break statement, click the Add Step button , select Flow Control and drag Break to the required location in the script.

Back to top

## Continue statements

Continue statements indicate that the current loop iteration should end immediately. The loop condition is then checked to see if the entire loop should end as well. For example, if a continue statement is encountered in the second of five iterations in a for loop, the second iteration will end immediately and the third iteration will begin. To insert a continue statement, click the Add Step button , select Flow Control and drag Continue to the required location in the script.

Back to top

See also:

- TruClient functions
- TruClient step arguments

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 All View Local Help Center View Online Help Center Version: