GlobalValue Function

Description:

This function returns the value of a variable shared between all Virtual Users.

Format:

result = GlobalValue(variable)

Parameter:

variable

A variable for which the shared value must be returned.

Example:

Virtual User 1 Virtual User 2
INTEGER IntVar { 0, 1, 2, 3 } GLOBAL;
 
INTEGER IntVar { 0, 1, 2, 3 } GLOBAL;
 
NEXT IntVar;
 
 
  NEXT IntVar;
 
LOG "UserID = " + GetUserId() + ", IntVar = " + ToString(IntVar);
 
LOG "UserID = " + GetUserId() + ", IntVar = " + ToString(IntVar);
 
Shared_Value = GlobalValue(IntVar);
LOG "UserID = " + UserID + ", Global IntVar = " + ToString(Shared_Value);
Shared_Value = GlobalValue(IntVar);
LOG "UserID = " + UserID + ", Global IntVar = " + ToString(Shared_Value);

Output:

Virtual User 1:
UserID = 1, IntVar = 0
UserID = 1, Global IntVar = 1

Virtual User 2:
UserID = 2, IntVar = 1
UserID = 2, Global IntVar = 1

See also:





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap