The Name macro is used to insert human names into the strings generated by a data source using the Custom String data generator.
The macro is an analog of the Name data generator.
Syntax
The macro has the following syntax:
%NAME(Gender, NameKind)
Parameters
Gender
Specifies the gender of names to be generated:
-
Any
– Default. Generates names of any gender, either male or female. -
Male
– Generates male names only. -
Female
– Generates female names only.
The parameter is case-sensitive. |
NameKind
Specifies the type of names to be generated:
-
Full
– Default. Generates full names. -
FirstName
– Generates first names only. -
LastName
– Generates last names only.
The parameter is case-sensitive. |
Examples
The following example demonstrates how to use the Name macro:
-
Customer's name: %NAME(Any, Full)
Generates a string containing full names of any gender.
-
%NAME(Male, FirstName)
Generates only first male names.
-
%NAME(LastName, Female) <- Invalid value
The parameters swapped places, so ReadyAPI will not parse the custom string.
-
%NAME(Any) <- Invalid value
The NameKind parameter is missing, so ReadyAPI will not parse the custom string.
-
%NAME(ANY, FULL) <- Invalid value
The parameters are case-sensitive, so ReadyAPI will not parse the custom string.
Remarks
For more information on adding macros to custom strings, see About Custom String Generator.
For more information on general rules used for specifying macro parameters, see Custom String Generator Rules.