Back
Create and use a global variable in Truclient Script

Create and use a global variable in Truclient Script

When we select the Runtime Settings > Replay > Simulate a new user for each iteration is selected, variables are cleared between the iterations.  So to access the variable in more than one iterations we need to declare that variable as a global variable.

Please follow below steps to declare the global variable in true client protocol.

  1. Add an Evaluate JavaScript In the Argumentssections add code to define the variable in the Init Block:

For example, Global.Number=5;The global prefix defines a global variable named number.

 

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

 

 

Isha training solutions is offering a ”TruClient Protocol Using LoadRunner” level course. For complete details, pls follow below link

TruClient Protocol Using LoadRunner Course Content

Leave A Reply

Your email address will not be published. Required fields are marked *

CLICK HERE – ISHA TUITIONS | Grades 1–12 | India • USA • UK • Middle East | CBSE • ICSE • IGCSE • Cambridge • IB • State Boards | CLICK HERE