Share this page

# lr_whoami

Returns information about the Vuser executing the script.

    void lr_whoami ( int *vuser_id, char *sgroup, , int *scid  );

Alphabetical Listing - C Language Utility Functions

## Arguments

Name | Comments
--- | ---
vuser_id | (A pointer to) an output argument to store the Vuser ID number.
sgroup | ( A pointer to) an output argument storing the name of the Vuser Group.
scid | (A pointer to) an output argument to store the Scenario or Session step ID number.

The lr_whoami function gets information about the Vuser.

Note that the sgroup parameter is a pointer (in C) to constant data and should only be read, not altered. Memory for the string is allocated automatically. You do not have to allocate it explicitly in the script.

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

If you do not want to retrieve one or more of the parameters, replace the parameter name with NULL.

Not applicable for products that do not run individual Vusers.

## Return Values

No value is returned.

## Parameterization

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

## Example

In the following example, lr_whoami retrieves information about a Vuser and places it into a message string. The message string contains Vuser login information that connects with a server.

Memory for vuser_group is allocated automatically. Do not alter the string.

Copy code

    int id, scid;
    char *vuser_group;
    lr_whoami(&id, &vuser_group, &scid);
    lr_message( "Group: %s, vuser id: %d, scenario id %d", vuser_group, id, scid);

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: