Share this page

# Create and use a global variable

When the TruClient Runtime Settings > Replay > Simulate a new user for each iteration is selected, variables are cleared between iterations. You can create a global variable whose scope exists between iterations.

1. Add an Evaluate JavaScript step. In the Arguments sections add code to define the variable in the Init Block.

   For example:

   Global.Number=5;

   The `Global` prefix defines a global variable named `Number`.

1. After defining the variable, use it in the Run Block. For example, use the variable to control script flow:

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: