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

lr.getAttribString

Returns a string type value of an argument passed to the script run.

Example Alphabetical Listing

Syntax

lr.getAttribString( argumentName );

Arguments

Argument Comments
argumentName The name of a script invocation argument.

The lr.getAttribString function returns the value of an argument that was passed to the run of the script. For example, lr.getAttribString("ipv6") returns the IPv6 address of the current Vuser.

To view the arguments passed to a script run, see mdrv_cmd.txt in the script folder.

Return Values

The function returns the value of the argument as a string. If the argument is empty (for example a flag), an empty string is returned. If the argument does not exist, NULL is returned.

Parameterization

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

Example

function Action(){
    var server;
    var user = "tomh";
    var password = "pwd";

    // If host is not specified, an exception is thrown.
   server=lr.getAttribString("host");

   if (server===undefined){
       lr.errorMessage("Failed to login. Unknown host.\n");
       return(0);
   }

   lr.outputMessage(user + password + server);

return 0;
}