JavaScript Functions > Alphabetical Listing of Utility Functions (lr) > lr.whoami

lr.whoami

Returns information about the Vuser executing the script.

ExampleInformational Functions

Syntax

lr.whoami ( vuserID );

Arguments

ArgumentComments
vuserID The Vuser id number.

The lr.whoami function gets information about the Vuser.

To access the scenario ID, add the scenario attribute to the Run-Time Settings. Add scenario to the Additional Attributes on the General tab. If the scenario attribute is not added to the Run-Time Settings, the scenario ID is always zero (0).

Return Values

Returns a JavaScript array containing the Vuser ID, the Vuser group, and the scid. The scid is the Scenario or Session step ID number.

Parameterization

You cannot use standard parameterization for any arguments in this function.

Example

result = lr.whoami();
lr.message(" vuser id: " + result[0]+
          " scenario id: "+ result[1] +
          " Group: " + result[2]);
// vuser id: -1 scenario id: 0 Group: undefined