To describe the format of text data that the custom string generator produces, you need to use a string containing a combination of special macros, string literals and regular expressions. Below is a sample formatting string that can be specified in the generator parameters:
This sample string contains the following parts:
Macros. The macro names start with the % characters and typically have parentheses. Macros generate data of the needed data type and insert it into the resulting string. Macros can have parameters. For more information about macros, see below.
String literals. You can use them to specify symbols that should be literally included into the resulting string.
Characters That Need Special Handling
When you specify the custom string (not macro parameters), ReadyAPI considers the symbols of percent
% and opening parenthesis
( as service symbols. If your custom string contains these symbols, you have to put the percent symbol before them. For example, you need to type
%% to specify the percent symbol and
%( to specify the opening parenthesis.
When you specify the macro parameters, ReadyAPI considers the percent and closing parenthesis symbols as service symbols. Avoid using them, otherwise ReadyAPI cannot parse a custom string.
You can use macros to insert generated data of various types into the string that the custom string generator produces.
Writing Macro Names
Macro names are case-insensitive and match the appropriate generators, for instance:
%INTmeans the Integer number generator.
%NAME– the Human name generator.
%COMP– the Computer Address generator.
For information on available macro names, see macro descriptions.
Writing Macro Parameters
Some macros require parameters. They are specified in parentheses. If the macro has no parameters, you can also skip the parentheses.
The parameters must be written in the specified order and separated by commas. The spaces between parameters are ignored.
When you specify the macro parameters, ReadyAPI considers the percent (
%) and closing parenthesis (
) ) symbols as service symbols. Avoid using them, otherwise ReadyAPI cannot parse a custom string.
The parameter values correspond to the values that you see in the setting of the corresponding generator. For instance, the Computer Address generator has the Address type parameter that can accept either the
Mac48 value. You can use these values for the %COMP macro in the custom string generator settings.
Some parameters are case-insensitive (for example, any True or False parameter), but some are not. For detailed information on macro parameters, see macro descriptions.